Maxwell's equations describe the behavior of electromagnetic waves, including their propagation through space. It's important to note that electromagnetic waves, including transverse waves, can exist in three dimensions and are not strictly limited to surface waves.
While it is true that surface waves, such as water waves or some types of seismic waves, occur at the interface between two media, electromagnetic waves can propagate through a volume of space. The transverse nature of electromagnetic waves refers to the oscillation of the electric and magnetic fields perpendicular to the direction of wave propagation.
In the case of electromagnetic waves, the oscillating electric and magnetic fields are mutually perpendicular and propagate in directions perpendicular to both the electric and magnetic field vectors. This perpendicular relationship gives rise to the transverse nature of electromagnetic waves.
Maxwell's equations, which describe the interplay between electric and magnetic fields, allow for the formation and propagation of transverse electromagnetic waves in three dimensions. These waves can travel through empty space (as in the case of light or radio waves) or through various media (such as air, water, or solid materials) depending on the properties of the medium and the frequency of the wave.
So, unlike surface waves that are limited to propagating along interfaces, electromagnetic waves can propagate through a volume of space, forming transverse waves with perpendicular oscillations of electric and magnetic fields.