Using the Dirac's theory of constraints, procedure of reduction of field degrees of freedom, whose number is restricted by equations of motion and topological conditions, is proposed. Such a procedure is applied in the case of space with the topology of a torus to the Chern–Simons gravity generalized by inclusion of a source. It is shown that in this system some modular transformations preserving the volume do not lead to physically equivalent states. Such a breaking of modular symmetry reduces the degeneration of quantum states with preservation of continuous spectrum of the volume operator. Probability of transition between spaces of different volumes is computed.