Mike Pearson wrote: ... and plugged into an exterior outlet permanently.
"Plugged in" is not "permanent", however, I understand what you are saying about the transformers being mounted on the wall.
Those low voltage landscape lights need to be installed in accordance with their listing and labeling (which includes the "manufacturer's installation instructions" ... MII ... ), and if the MII states/allows for hanging the transformers on the wall, then that is permitted. My recollection is that many/most have 'keyhole' mounting slots for that purpose.
And, yes, installed "per code" ... under the applicable LV sections and their MII.
The main things to check for are GCFI protection of the receptacle outlet and a proper 'bubble type cover' which can be fully and properly closed when the cord is plugged in.