How does an audio transformer work with DC in this circuit?
As you pretty much guessed, then transformer works when DC is applied initially. This causes a change in current through the windings.
As the formula V = L(di/dt) shows, a change in current will produce a voltage across the inductor, proportional to how quickly the current changes.
So when you touch the wand to the maze, there is a step change in voltage across the primary winding which falls off as the current rises, and this appears stepped up (assuming a step up transformer) across the secondary winding. The same effect will occur but with polarity reversed when the wand is pulled away from the maze and the current flow is stopped abruptly.