Great comment from the comment section....
“There are only two genders, our chromosomes dictate that, we know that our brains can and do lie to us that is how hypnotists and con artists flourish. It then stands to reason that if your brain is telling you that you are a different gender than you body is programmed to be, then you have a malfunctioning brain that needs treatment, not society helping you deepen your delusion.”
Sex refers to Male and Female.
Gender refers to Masculine, Feminine, and Neutral and usually but not always corresponds with Sex when applied to people and animals. In many languages gender is also a applied to all nouns whether they relate to sex or not.