Ok let say instead that society or culture don't see gender anymore, there is no gender role, no gendered clothes, hair or anything like that. There are only people with different body. Would people still identifying to a gender? Probably?
My point is trying to see what defines gender for an individual.
For some people there are sex and gender, sex being genitals and chromosomes and gender being a state of mind.
So for some, there are two sexes and two or three genders. But people are asked on their own personal experience, why they see themselves belonging to a gender, so obviously if they belong to the majority, they will tend to define their gender according to their sex, if they relate to it or not.
But it's not that easy because there are also people that don't have a defined sex, they don't have the chromosomes related to their genitals or the same genital as everybody, there are people who have genital dysphoria and no gender dysphoria, or gender dysphoria and no genetial dysphoria and so on, so we can't really say that gender is related to sex for everybody.
For some people is definitely gender roles, but if society was switching gender roles tomorrow, a bunch wouldn't follow.
For some it might be the representation of masculinity or femininity but again it's something that might change tomorrow.
Society change, fashion change all the time, so you can't really defined gender just that way either.
So why/how do you relate to a gender? (If you relate to one) There is no bad answer, There is no right answer.