If gender is separate from biological sex then what meaning does it have for someone to say they identify as a man or a woman? What is a man? What is a woman? Are they a grouping of mannerisms? If we engineered ourselves to have no sex and then we all selected our genders, how would we quantify what those genders represent without any biological context?
“Gender” in the broad sense is one of several possible social constructions of divisions of people into groups and associated distinct expectations and roles; it is a feature of the social context. While there is considerable variation in between social milieus, it is always grounded, to a greater or lesser degree, in current or historical stereotypes associated with some subset of anatomical sex traits; in fact, that’s part of what we use to identify which of the many socially constructed divides in a society is gender.
“Ascribed gender” is how other people treat a person with regard to gender.
“Gender identity” is how a person sees themselves and prefers to be treated with regard to gender.
None of these things are disconnected, in either practice or the theory of the major factions, from biological sex (the last is arguably itself either a biological sex trait, a set of biological sex traits, or an interaction of biological sex traits with the social context; for it to be anything else either requires dualism, or an arbitrarily restrictive definition of “sex”), except that maybe the side opposing recognizing gender identity as the basis for ascribed gender thinks gender identity is divorced from biological sex.
It depends on who is doing the identifying. When a woman identifies as a woman, or a man identifies as a man, they are making a statement about their sex, on whether they are female or male.
When a man identifies as a woman, he is expressing his desire to be a woman, based on his ideal of what a woman is. Similarly, when a woman identifies as a man, she is expressing her desire to be a man, based on her ideal of what a man is. Neither have any direct experience of actually being the opposite sex, of course, so this ideal is based around gendered stereotypes and superficial cosmetic traits, particularly those related to sexual attraction.