The secure units have to be in male prisons. No matter how separate they can be kept from the female prisoners (and as far as I can see they are often allowed to "socialise" or exercise or be educated in parallel), but the female prison staff must also be kept safe.
Vulnerable male prisoners can be kept separate from violent male prisoners in male prisons. Violent male prisoners can also be kept away from other male prisoners in male prisoners. Male trans prisoners can be kept safe from male prisoners in male prisons.