Transformer and Rectification confusing
The rectified mains frequency isn't fed directly into the transformer, but the transformer rather forms the core of a switching power supply.

The size of a transformer is largely dictated by two things: How much power it handles, and how high the frequency of the AC is. Higher power and lower frequency transformers are physically larger and thus more expensive.

Assuming you have some fixed load, you can't do much to reduce the amount of power it has to handle, but of course you want to make your device as cheap as possible—so you increase the frequency. The way this is done is by first rectifying the AC to DC, then using some control circuitry and at least one power transistor to alternatingly apply Vdc and 0V to the transformer at a high frequency; a few dozen kHz or even a few MHz. Since your transformer is now dealing with high-frequency AC instead of low-frequency 50/60 Hz mains, it can be much, much smaller for the same amount of power.

It's the high frequency switching that is important here, not the mains frequency ripple. As far as the transformer is concerned, that ripple is "basically DC" since the transformer is designed to operate at much higher frequencies.