Transformer going into receptacle obstructed by board behind it
Use a
metal box cover with a knockout in it.
I think you will have enough room to access the screws of the cover. You will need a plug for the knockout on the side.

Or, the box is surface mounted, add a spacer behind it.