What is a good way to protect the low voltage wiring on a doorbell transformer?
Given it's low voltage wiring, you could put pretty much any sort of box over that mess. 

Sure, you could wrap it inside a nice electrical box with an appropriate sized hole in the back for the transformer. It will cost some money, but it will also give you conduit options, etc.

Then again, you could cut a hole or 3 in a plastic shoebox and screw it to the wall, because it's low voltage and does not technically need any protection. 

Or you could put a wooden box over it (but it has to be one you can open, as you can't make the junction box inaccessible) - say a free removed cabinet, and you remove the back and screw it to the wall over the mess. Or you build a simple open box, screw it to the wall, and add a door to cover the front. Possibly just a shelf below would make it less likely to be hit/snagged (with cleaning up the wiring.)

You could also tidy the mess up and staple/wire-tie it close to the wall, without all those loops just waiting to snag things, and call it done. Or you could get some adhesive-mount plastic wiremold to cover the wires, but you still need to tidy up those loops.