Gender has nothing to do with biological sex (other than stereotypes). Most transgender people will agree with this and indeed argue that gender has got nothing to do with what is between your legs.
So why then are people allowed to change their sex on their birth certificate and erase their past? How you present or what you do to your body has nothing to do with biological sex. Why would you want to do this if gender is unrelated to sex?
I'm guessing it's because historically people were classed as transsexual rather than transgender but once it became transgender surely 'changing' sex legally should have been stopped rather than the two being conflated? I'm told gender is a spectrum so what are you transitioning from/to?