At the moment woman means a woman and by virtue of s.9 GRA 2004 a trans woman who has a Gender Recognition Certificate (GRC):
(1)Where a full gender recognition certificate is issued to a person, the person’s gender becomes for all purposes the acquired gender (so that, if the acquired gender is the male gender, the person’s sex becomes that of a man and, if it is the female gender, the person’s sex becomes that of a woman).
(2)Subsection (1) does not affect things done, or events occurring, before the certificate is issued; but it does operate for the interpretation of enactments passed, and instruments and other documents made, before the certificate is issued (as well as those passed or made afterwards).
The Equality Act 2010 provides that nobody must discriminate against, harass, or victimise anybody on the basis of either their sex or their gender reassignment.
s.212(1) of the EA 2010 defines a man as a male of any age and a woman as a female of any age.
Gender is not defined, although gender reassignment is.
So the answers to your questions are
Can anyone tell me if there are legal and medical definitions of the terms gender and sex
Legal ones, yes: s.212(1) EA 2010 defines man and woman as male and female, and s.11 EA 2010 defines sex as a man or a woman. No definition of gender is given.
whether sex and gender are legally and medically defined as interchangeable terms or different concepts
Interchangeable terms in the GRA 2004; it's horribly badly drafted.
and whether gender reassignment automatically changes your sex for the purposes of interpreting the Equality Act.
Yes, but only if you acquire a GRC.