Had trouble with 20W led bench lamp flickering, been that way a long time, finally swapped lamp and chopped open the offending item. Cut away the grey goop potting stuff and…
Inside is a typical power supply based around a BD3216 chip. A close look shows the mains fuse ended in a dry joint with a black burn mark. Also L3 the buck inductor is missing, it came away with the potting – it too seemed a bit cooked. The mucky soldering on the led assembly is original.
From a quick trace of the circuit the transformer is part of the Vcc power supply and feedback loop.