I'm not following what your understanding of a transformer for an alarm system vs. a wall wart for a different device, so feel free to clarify your statement.
Code doesn't differentiate between a plug in transformer and one that is mounted on a box spliced to line voltage conductors within a box....a transformer is a transformer. The only difference is how it connects to the line side of the feed, either via pigtail or plug in. You wouldn't be allowed to run something like a power whip carrying 120VAC from the plug within the wall to the load, such as 120VAC from a plug to a power supply that has a transformer inside, that's an example of a Class 1 power circuit (light and power)
Once the transformer is plugged in, no high voltage exists (no exposed plug, etc.) and the transformer is an inherently limited power source, Class 2, so exposed cabling is allowed within code, same with having splices and similar not being required to be within an electrical box or enclosure. The Class 1 circuit ends at the duplex recepticle and becomes a Class 2 (or even Class 3) load at that point and wiring methods and material requirements change at that point.
The only time you would not be allowed to run wiring for LV behind a wall would be if the cabling or assembly is not rated for in-wall usage, such as many wall warts, like those that come with consumer electronics, like a cell phone charger, cordless phone or similar.
Of consideration, in the case of LV lighting where a separate transformer is installed and connected to a HV feed, as long as the secondary side of the transformer meets the criteria for a Class 2 or Class 3 load, you can still run it concealed as long as the methods and materials are correct. Most people also seem to confuse what is allowed above a suspended ceiling or similar, as any flexible cordage being plugged into an outlet is viewed as temporary for many definitions.