If I had worn a tie, I would have been way over dressed. only people in ties were the lawyers standing around waiting for other courtrooms.
I wore black pants and a collared shirt, no jacket. Khakis would haves been more than fine. Unless you live in some weird state that is known to have issues with trans people changing their names, it will likely take 5 minutes once it is your turn, and the judge will just robotically go through the motions.
I didn't even need to schedule a court date though, you just filled out a form and signed up for the next slot that same afternoon. It seems like a much bigger deal in some places, so YMMV. I can't imagine what a lawyer would have added to the process, other than to charge me for standing there while the judge asked me 3 stock questions I answered with one word each time.