So "primary" is mains input, marked 230v, and "secondary" is the safe extra-low voltage of (about) 12volt. The Primary L wire should be insulated in brown (or red, if old) and the N should be blue (or black, if old). The earthwire, if present, will be green and yellow (or green, if very old).
It looks like the incoming flex for the Primary supply is gripped by that cable gland in the middle of the "Eaglerise" one. The nut tightens to grip it.
On the black one, that might be a black cover with cord grips under it. The flex sheaths should be gripped by something to prevent them being able to pull out of the terminals. If necessary, those white plastic pillars can be used for a strap-type cord grip to be screwed in. They ought to have been supplied, if they are needed. I don't know where you'd buy such a thing, it's one of the things you accumulate in your electrical toolbox, when you take them off old devices or plugs. Maybe if you need them but haven't got them, you could email the maker or vendor and they might send you a couple.
If you have to connect any wires outside the transformer, they must be in an insulated enclosure like a choc-box, I can give you a link if you want.