Yes it is in the brain's assertiveness and in the mentality as well as the mindset, the bodily appearances make up part of that mindset that makes people recognise and accept their gender. So I find it wrong when people say it is not about the body, when you look at a woman sometimes you will see they easily develop a kind of gait for either talking, walking or eating and it is peculiar and familiar with only the feminine gender, the mentality that comes with gender works with your bodily appearances at the same time it comes with the characteristics and features that are often associated with the gender of either a man or a woman.
Sometimes it is in the responsibilities which the society places on gender for example let's take an experiment that you do not know what your gender is and you definitely want to find out from people who see you, you will see that that gender sometimes depends on responsibility, for examples women are expected to bear children and take care of the children while men are expected to show support in all ramifications as well, so sometimes the society contribute 2 gender awareness as a result of the responsibilities being placed on the different genders.
Another thing that may determine your gender is your relativity with yourself and people for example women are often recipients of things like open places proposal whereas men are the people who often at the subject of open places proposal sometimes it can also be norms and culture that you may use to recognise your gender even if you do not know it. Some cultures traditions and even norms sometimes have specific duties and functions for both genders. So it is either the society all the relativity which we have with people in your society sometimes you can even understand your gender by looking at your brain assertiveness and the kind of mindset and perceptions which you cultivate I believe these are peculiar to genders and not the same