Welcome to the forum!
First thing to do is to take apart the track and clean it with Naphtha dabbed on a rag. When that is done, gently bend the pins on the end of the tracks so they make a tight fit when pushed together.
Next get some Q-tips, dip them in the Naphtha, and clean all the wheels of all your engines and rolling stock. Clean all the engine, tender and any operating cars roller pick-ups also.
Once this is done, any issues with the engine can be taken care of, but you must have clean track first.
The 40 watt transformer is rather small. Upgrade to at least an 80 watt CW-80 or higher wattage transformer.
Larry