https://threadreaderapp.com/thread/1612878675594121223.html
Key message is If you don't collect data on the Equality Act's protected characteristic of gender reassignment you cannot know that you are not discriminating against those with that protected characteristic. 15/26
Asking about a personal characteristic such as 'gender' that is not a protected characteristic under the Act, may be in breach of the UK GDPR by processing personal - and potentially Special Category - data without a lawful basis. 16/26
The Government provides a list of the personal data an employer may hold about an employee without their permission that you might also find useful. 'Gender' does not appear on that list, but sex does.
As you can see it's a v long thread detailing the ins and outs. Might be helpful to take to HR's if needed.