The best form of defence is prevention. If at all possible don't put yourself in a situation where you could be in danger.
There are many places, roads, paths etc that a woman would avoid placing herself in, and for good reason. In male mode I'll admit to paying scant thought to such issues - I am well built, and probably don't look like the type of person you would chose to start of fight with. However, in female mode that natural defence is gone, and I would be crazy to present myself in a vulnerable place.
If a "situation" does present itself, no matter how you are dressed the best response is to get out of there. If you are in a car then drive off, if on foot then run. Be aware of what is around you, and try to avoid giving clues (such as obviously looking behind you) of what you are about to do as that will buy you a few extra seconds. It is better to be a bit out of breath having run a short way for no reason than waking up in hospital because you gave them a head start!
Take self defence lessons, but hope you never have to use them. They are a good idea for anyone, but essential for those of us who know we are going out in a manner likely to attract unwanted attention. They will give you a much better chance of dealing with the situation if you can't get away, but remember there are many random factors you can't control in a fight, so avoidance is always better.
Finally, never carry or produce a weapon of any nature that you don't know how to use and are sure that you are prepared to use. Once you draw a weapon of any kind you are "upping the stakes" and may make your attackers feel like they are now fighting for their own survival - which can make things a lot worse for you. Remember as well that anything you introduce into the "arena" can potentially be taken off you and used against you unless you know exactly what you are doing with it.