The transformer doesn't really "know" that it is made up of lots of sinusoids. In fact, this is precisely the concept of superposition. For instance, lets treat the transformer as a black box. We are putting a signal in that is composed of many other signals, x1, x2, x3, etc. We have some composite output y, that is made up of y1,y2,y3, etc. Rather than do the complex analysis (which would probably require a simulation), we can find what y1 is from x1, y2 from x2, y3 from x3 and then just add those up to find the composite signal y.
So why did I got through that. Mainly because you can think of the transformer of looking at it the same way. For simplicity, we put in three signals, f1, f3, and f5, which are the fundamental and two harmonics. The transfore is designed for f1, so it works the best at that frequency. At the f3 frequency it will work, but might not be as efficient so it gets warm. f5 might be so far off that none of the energy is converted and it all goes to heat.
So in summary, when you stick your signal into the transformer, you are putting in lots of AC frequencies, your transformer will have some frequency response to each one.