They probably have a dress code, and it probably does not allow people who are legally male to wear skirts or dresses (that might have changed in some places, replacing it with a non-gendered dress code that allows skirts or dresses, but I would definitely check if you opt to come dressed.) Even if you wore pants, they may not like it if you wear makeup or a wig (if you wear one) or prosthetic breasts (if you wear them).
If there is a dress code you break and/or you ask to be referred to as a woman when you are legally still male the judge, in theory, could hold you in contempt if he wanted to. That is not something I would ever, ever risk! It might be more bearable if you are dressed, and as far as I am concerned you should be able to dress however you like given they are literally forcing you be there against your will, but I still wouldn't risk any potential legal consequences.