Under Schedule 16 of the Equality Act, an association can restrict membership to people who share a protected characteristic. Tht can be sex or gender reassignment, and members don’t all have to meet both. The law doesn’t say everyone in the group must share every characteristic, just that the association must be set up for people who share a relevant one and apply its rules consistently.
If the group is for biological women and trans women, who are protected under gender reassignment, you can lawfully exclude a man who doesn’t share either. That isn’t unlawful discrimination…