The SNP government is threatening equalities legislation as it attempts to defend sending trans women who commit crimes to women’s prisons