I present a new formulation of wave-packet spawning procedure based on a second order perturbation theory expression for population transfer between different diabatic electronic states. The employed perturbation theory (PT) expansion is based on an assumption that diabatic states can be represented locally with their Taylor series up to quadratic terms in nuclear coordinates (local harmonic approximation). The corresponding local harmonic basis of vibrational states makes infinite summation over excited states in PT expressions possible, and thus, it provides a complete basis set expression for the population transfer. This allows me to detect when a finite basis set expansion employed in variational wave packet propagation does not adequately describe the interstate population transfer. Also, it suggests a rigorous criterion for basis set expansion (spawning). The proposed procedure is illustrated for the variational multiconfigurational Gaussian wave packet method applied to 1D and 2D model examples, and it also can be extended to direct on-the-fly dynamics with any Gaussian wave packet propagation method.