A generalized canonical representation of the Hilbert-Einstein action is obtained within the De Donder-Weyl formalism, preserving the equality of space-time coordinates. Unlike the conventional canonical formalism with a distinguished time parameter, the generalized Hamiltonian function does not reduce to a linear combination of constraints, and the energy of a closed universe is non-zero. Its distribution is a 4D scalar density. The contribution of the Yang-Mills field to the scalar energy density of the universe is found. To quantize the theory in generalized canonical form, a quantum principle of least action is proposed, in which the action integral is an operator on the space of wave functionals depending on the world history of the universe in the region under consideration. The secular equation for the action operator is considered as the fundamental dynamic equation on the space of wave functionals. As a consequence, a local wave equation is obtained that functions as a non-stationary Schr\"{o}dinger equation for the components of the wave functional. The role of the time derivative in this equation is played by the covariant 4D divergence operator, and its source is the non-zero 4D scalar energy density of the universe.