Ideal DC Transformer in LTSpice
You probably mean a small-signal DC transformer, for use in .AC analysis. If so, the basic configuration is a current source at the input, dependent on the output current, and the output  voltage source dependent on the input voltage:



Both obey the external parameter, D=Ton/T. This is fixed, however, so to make D variable, you need to replace it with a voltage:



If the waveforms will have sharp transitions &amp; co, you may need to add a Cpar=&lt;...&gt; to the input source. Or, if the output voltage proves to be too "stiff", replace it with a current source, like this (note the changed sign in Bin):



This also adds the possibility of an output resistance, which makes the circuit behave more like it should in a real world. Be sure to not exaggerate with the values, for example try not to set Rout=1n, because that would mean there would be a division by 1n, or 1G, side by side with 1n, which would make a dynamic range of 1e18 -- this is an almost guaranteed method to bring out timestep too small errors. In general, 1000x less than what you'd expect should do anywhere. Add a grain of salt and you're done.