A transformer is not a regulator.
Say I have 100v and want to light a 5v light bulb.
1.) I could use a resistor but it would get hot wasting a lot of power to drop 95v.
2.) I can wind 100 turn of wire on the 100v side and 5 turns on the output and this will give me my 5v and this is a transformer. They can be over 98% efficient but with lots of copper wire and an iron core can be both heavy and expensive.
3.) The third option is I can switch on the 100v for 5% of the time and off for 95% and with some capacitors and inductors smooth the on off pulse into a steady 5v to light my bulb. Switching power supplies can be 98% efficient. They can also be light and low cost. Since there is switching the switching noise, while filtered, can make a transformer preferable in some application.
Of the 3 only 2 works well in reverse. What's this have to do with a UPS? To have your 2kv for 30 sec you must store the power. The two common technologies are batteries and possibly capacitors. Both technologies are low voltage and DC.
So, you have a 12v battery but want 2kv. You will need a transformer with a 167:1 turn ratio, actually a few more due to losses. Transformers require AC so you will need switching devices to switch the battery voltage. If you need precisely 2kv it is efficient to sense the 2kv and use that to control the on to off ratio of the switching circuit associated with the battery. This is called regulation.
Ps you will likely want to keep the 12v battery charged using 110v or 220v so see 2 or 3 above.