Here is further clarification on the distinction between sex and gender identity:
Most people are born with a body that is clearly either male or female. So, for example, when a boy has a penis and testicles, we can say that his phenotypic sex is male, and when a girl has a vagina and a uterus, we can say that her phenotypic sex is female. In other words, sex refers exclusively to biological features: chromosomes, hormones, and internal and external anatomy.
Intersex is a term that refers to people who display a variation in sex characteristics at birth that does not allow for distinct identification as either male or female. Sex characteristics that vary include chromosomes, hormones, reproductive organs, and/or genitals. An intersex person will adopt a gender identity that best reflects how they feel, the same way non-intersex people do.
Transgender is a term for people whose gender identity does not conform to what is associated with the sex they were assigned at birth. It is sometimes abbreviated to “trans”. Individuals who are “trans” may transition from one sex to another, through the use of hormones and/or surgical procedures, to become visibly recognizable as being of the opposite sex. They are unable, however, to change their genetics, nor are they able to acquire the reproductive abilities of the sex they transition to.
Gender identity refers to how a person sees themselves in terms of gender. Some people may feel as though they were born with the wrong body parts, or in the wrong body, because their sense of gender identity does not correspond with their birth-assigned sex.
Gender is also a social construct that is greatly influenced by culture. Socially constructed roles, behaviours, activities, and attributes seen as typical of one gender or another can vary greatly across different societies and groups.