On the transformation of modal bases in rectangular waveguide