The legal system should not be responsible for deciding how long someone has been living as a woman in order to determine prison placement.
If you are born male, you should be placed in a male prison.
If you are born female, you should be placed in a female prison.