  The technique of transformation optics (TO) is an elegant method for the
design of electromagnetic media with tailored optical properties. In this
paper, we focus on the formal structure of TO theory. By using a complete
covariant formalism, we present a general transformation law that holds for
arbitrary materials including bianisotropic, magneto-optical, nonlinear and
moving media. Due to the principle of general covariance, the formalism is
applicable to arbitrary space-time coordinate transformations and automatically
accounts for magneto-electric coupling terms. The formalism is demonstrated for
the calculation of the second harmonic generation in a twisted TO concentrator.
