"Identity" isn't the magic word to some that it is to others.
The more I think upon this, the weirder it gets.
Whenever someone asks me to identify myself, I typically provide them with a set of identifiers which are in some sense objectively verifiable, e.g. I'm the person who has the face in this state-issued photo i.d. card, I'm the person associated with this federally issued social security card, I'm the person born in this particular hospital on this particular day, to that specific woman, I'm the person legally adopted by this specific man on this specific day as this specific county courthouse, I'm the person who was married to this one specific person on this specific day, I'm the person who was discharged from this specific branch of the U.S. military on this specific day, etc. and so forth. Typically there are pieces of paper and signatures to attest to each of these things, any of which helps to establish my identity.
If you were to ask, "Why do you identify as married?" I could show you the certificate of marriage. If you were to ask, "Why do you identify as a veteran?" I could show you my DD Form 214. If you were to ask "Why do you identify as Puerto Rican?" I could show you my father's birth certificate.
Not all identities are demonstrable on paper or even easily documented, though. If you were to ask, "Why do you identify as atheist?" all I could do is point out that gods are obviously made up, and if you were to ask "Why do you identify as a skeptic?" all I could do is point to the various harms caused by those to prey on credulity. If you were to ask "Why do you identify as a Connie Willis fanboy?" all I could do is gush about her novels.
So I guess some identities are about one's life experiences, demonstrable characteristics, legal forms, etc. and other forms of identity are about one's subjective state of mind. I suppose gender can be either, or both?