A transformer offers a good and reliable conversion of an AC voltage to another AC voltage. You can do this also with an electronic converter or a motor-generator arrangement, although the transformer is always the best because it provides galvanic isolation. You could use an electronic converter which first converts the AC to DC and then inverts the DC to the requested AC. Of course the device should be equiped with filters and voltage regulation in order to get a good output signal. For extra high voltage ratios this is not easy or reliable without a transformer. For small supply units, variacs or similar an electronic converter is a good choise (see laptops, mobiles etc). For power applications like the distribution transformer with power rating of kVA or MVA and voltage ratios like 20000/0,4, I would propose the motor-generator instead.