As one who had been working in the electronics industry most of my life, I can offer a few comments here..
The train transformer, or any transformer for that matter, powered from the AC line.
Will it work. Sure. Is it dangerous? Yes. I will tell you why.
It is not that the transformer is likely to hurt you on it's own. Even if the input voltage goes up, worst case, the output voltage will go up proportionally.
The problem lies in grounding and isolation and the way the power grid works. Ideally a transformer should have 100% isolation between the primary side (the side you typically plug into the wall) and the secondary side. This is ideally however. Regular transformers are randomly checked for isolation, but I would not bet my life on it. Medical quality transformers cost a lot more, and they are built to very strict standards to ensure full isolation between the input and the output.
So, what happens if this isolation is compromised? Most of the time nothing. You will never get the full line voltage on the secondary directly. However if there is a short between the two coils, you can get the full line voltage between either half of the secondary and ground or neutral. Even if the compromise in the coils is at the neutral side of the primary coil, if there is a large load on that branch circuit, a large transit can occur between ground and neutral.
This means if you are grounded somehow, as in contact with the ground or in contact with something that is grounded, you can get up to the full line voltage between one side of the transformer and ground. And you will still see the proper low voltage across the secondary.
This is because of the way the power grid is wired. Ground and neutral are connected to the same bus at your breaker box, but typically there is a load on the neutral line and no load on the ground line so there is a voltage drop across the neutral line, and there is not a voltage drop across the ground line. Thus at any given box ground and neutral can have a potential across them, and when a large load is turned on, that load can create a very large short term sag in the voltage on the neutral line, and a very large spike between neutral and ground.
FWIW The GFI outlets you see in kitchens and bathrooms sense any current flowing through the ground connection and cut out if they detect this situation. If you need to play unsafely, at least use a GFI outlet.
Also, stay away from variacs, or autotransofrmers. They really only have one coil and provide no isolation.
So, the long and the short of using a transformer is yes it will work, but you are also using it in a situation that it is not designed for. Think about using $1 store rope for overhead lifting of heavy objects. Same kind of an idea.
BTW, you can and in every design for stimulation units I have seen, use some kind of a waveform generator that runs off of batteries (a totally isolated power supply) and uses a transformer "backwards". The small transformers these units use are typically used to step voltage down, but they also work backwards.
For the purest s, you do not get something for nothing... You get a higher voltage but also a higher internal impedance (ie, less available current). At best you get the same number of watts out that you put in, and you never even get that. You have both restive and magnetic losses.
OK, that is where my knowledge of this tapers off. I am pondering building a unit of my own.. Does anybody out there know roughly the frequencies and duty cyucles hese work at and the range of voltages you want on the electrodes?