Living as female in England does not mean you have to be treated as female in all Cicumstances, or indeed in any circumstance , where sex is a protected characteristic, unlike gender identity.
Hmm, no that's not correct. There is a transgender protocol for prisons, they follow that.
This is the English one:
www.justice.gov.uk/downloads/offenders/psipso/psi-2016/PSI-17-2016-PI-16-2016-AI-13-2016-The-Care-and-Management-of-Transgender-Offenders.docx
I can't be bothered to find the Scottish one, but I don't imagine for a moment it's less regressive, Scotland is always trying to out-woke England.
Even with the protected characteristic of gender reassignment ( formal process ) in England it would be allowed to treat the person as male rather than female, although then there would be a requirement to have a strong reason.
Well not under the prison protocol, under the prison protocol if you have a GRC or are even in the process of applying for one, then you have an unrefutable right to women's prison. Rights under the Equality Act etc. are essentially irrelevant, because there are a set of specific guidelines they follow for prisons.