In the UK, a recent Supreme Court decision has clarified that "sex" in this sort of context refers to biological sex, and is not affected by any shenanigans with birth certificate changes or GRCs.
https://en.wikipedia.org/wiki/For_Women_Scotland_Ltd_v_The_S...