I think it's necessary to distinguish between "gender identity" and "gender" itself.
You will often hear the meme expressed that gender is a "social construct." This is a sociological definition, and it doesn't work in the real world. Technically, all concepts are "constructs" in that they are creations of the mind "constructed" in response to experience with the objective world. But, simply because our concepts are artificial does not mean that the objective world is. Our concepts are tied to experience of something real, something that exists whatever we may think about it -- or even if we don't think about it at all.
Here is the nasty little bomb hiding in the "social construct" meme. Since all concepts are constructs, calling one specific concept, gender, a "social construct" can have only one purpose: to emphasize the notion that gender is merely an idea created within a social bubble and having no real meaning outside that bubble -- in other words, to say that gender means whatever society says it means, and nothing more. In other words, it is to say that gender isn't real, or has no "essence."
It should be obvious, at this point, that the "social construct" meme is unworkable; for, if gender isn't real, than being transgender isn't real. And, if being transgender isn't real, then anyone who thinks they are transgender is delusional.
This is quite a natural position for a Right-wing reactionary to take; but for a transgender person to take this position is more than a bit bizarre, since it delegitimizes them as transgender. For a trans woman to take the position that gender is a social construct is the same thing as saying, "Hi, I'm Ann, and I'm delusional."
How, then, should we define gender? I'll share the definition that works for me: a hypothetical, intangible, objective quality on the male-female spectrum that is usually confluent with sex but is potentially divergent therefrom. And the term "gender identity," then, refers to someone's perception of their own gender.