OK Billy - it becomes clear - this is little to do with the transformer but more to do with the light fitting...
You need to connect two wires to the light fitting to supply 12 Volts and can't see how to manage it - a wire from the transformer isn't long enough to reach the light fitting and even if it were long enough you can't see how to make a connection.
It all sounds very strange to me - the bit about touching the wire to Earth and the light coming on - clearly the bulb also has a connection to earth else it would not come on.
In your place I would remove the light fitting - you do not describe it so it's difficult to visualise - and examine it to see just how the return path is made. I doubt that it meets electrical regulations as it is - and if there's no room for two wires then use thinner wires that are long enough - the colour doesn't matter.
The bulb should definitely not work as it does - it's not like car electrics - there should be no earth connection.
I suspect that whoever installed it only had FAT wire and tried to be creative.
Take care...
Good Luck...
September 2016