The definition is in para 265 of the judgment and follows that given in the Equality Act 2010:
"The meaning of the terms “sex”, “man” and “woman” in the EA 2010 is biological and not certificated sex. Any other interpretation would render the EA 2010 incoherent and impracticable to operate"
For the purposes of the EA 2010 a person with a gender recognition certificate is not treated as being a woman but is still a man.
The law is that sex is binary and that you are either male or female from birth.
If you are asking a different question of what is the definition of sex at birth then the EA 2010 gives that as being the sex that is recorded on the birth certificate.
So, that's down to doctors.