A priori error analysis of space–time Trefftz discontinuous Galerkin methods for wave problems