Does a 300W Transformer use 300W when a 12W appliance is connected?
A basic rule for transformers is: Power in = power out plus losses.

With no load, your transformer will take a few watts, just keeping the core magnetized and wasting a bit as heat due to resistance in the primary winding.

With a small load, such as your 12 watts, the transformer power input will be that 12 watts, plus the few watts it would consume without a load, and a bit more, due to increased current.

The 300 watts is the maximum recommended load - exceeding that will overheat the transformer, and may cause some damage (beware if you smell burning transformer varnish!)