Could sawtooth waveform be optimal for transformer input?
The optimal input waveform, as far as the core flux is concerned, is a square wave. It turns out that while sine wave is a sub-optimal, because it's the 'natural' waveform for generation and for 3 phase power distribution, it is used as is.

The key to understanding inductors and transformers is to recognise that voltage and flux are linked, not proportionally, but through an integral, so flux = \$\int\! V \, \mathrm{d}t\$ and voltage = d(flux)/dt

If we apply a finite voltage to the primary of a transformer, the flux will begin to slew, at a rate proportional to the voltage. The changing flux will induce a voltage in the secondary, which can be used to drive a current through the load.

If we had magical materials to hand, so a core of unobtanium with infinite permeability usable to infinite flux, we could leave this DC voltage connected indefinitely, and the transformer would continue to transmit power, while the flux ramped continually upward, the magnetising current held to reasonable levels by the unreasonable core permeability.

Unfortunately, we have the practical problem that we need to use real materials, iron or ferrite, for the core, and these will eventually saturate. When that happens, the flux stops increasing, and the output voltage collapses to zero.

In order to avoid saturation, we reverse the input voltage just before the core saturates. With the reversed voltage, the flux slews back down again, through zero, and approaches saturation in the opposite direction. Reverse and repeat.

If the core were the only consideration, we could reverse the input voltage as quickly as we liked. All it would do at the core is alter (very quickly) the direction that the flux was slewing, the flux itself would be continuous. In practice, nothing can generate a very sharp edge, the capacitance of the windings would not permit a very sharp edge, and as long as the edge is 'much steeper' (say 10x steeper) than a sine wave, we will have the bulk of the efficiency improvement that we are looking for over a sine waveform.

Running a transformer at best efficiency, we will slew the flux from near -max flux to near +max flux. As the change in flux is the integral of voltage, any waveform that does this will have the same mean voltage over the half cycle. If a sine wave with a peak of 1 swings the flux over this range, then a square wave would need to have a peak of around 0.7 to have the same average.

The power delivered by the transformer into a resistive load depends on both the output voltage and the output current. With sine excitation, the current and voltage vary between 0 and max during the cycle. With square wave excitation, the voltage and current stay at the maximum level for essentially the whole cycle, so have a slightly higher power throughput.

Iron transformers on power networks tend to use the approximately sine-wave voltage transmitted. High frequency ferrite transformers, powered by switching devices from a DC bus, use the naturally produced square waves. Much more significant than the input waveform is the operating frequency, and the size of the core. It is almost never worth the bother of changing the input waveform from "what's easy" for the small gain that would result.