I don’t think this was in practice pre-ww2 but I could be wrong. I would guess it’s more based on religion than anything else.
Discussion
it was definitely in practice pre-ww2. The schools my grandparents attended are still around (Taiwan), still same traditions 🥳
I looked it up, that style school system was established by the Meiji (1868) government modeling European (German/Austrian?) school systems -- to bring Japan into the modern era and establish their empire
So it has nothing to do with militarization
depends how one looks at it, handing over education to the state (emperor in this case) probably a pre-requisite to undergo militarization -- the islands of Japan were never capable to raise national armies before.
Like part of a skill tree to unlock to raise an army across an empire.