Topological transitions among skyrmion- and hedgehog-lattice states in cubic chiral magnets