I've got a very basic question - I have a 120V to 24V transformer https://www.functionaldevices.com/products/building-automation/details/TR40VA040/ and on the transformer surface it calls out "install in metal box only". So my understanding is that it's supposed to be screwed into the metal junction box, but the transformer itself is to be located outside of the box, possibly in the wall cavity, like pictured here:
Is this a correct way of positioning the transformer? Or does "in metal box" mean literally "inside of the metal box"?