This is an interesting question that I'd love to answer, but my level of knowledge about samurai-era Japan fluctuates - I know about the Sengoku era and what followed, but before that all I can really say is 'there were samurai. Lots of them'
That said... A successful Mongol invasion could help. If it succeeds, but doesn't last for too long, then it
could encourage Japan to look more outside its own borders, and adopt new technologies. At the very least, develop a fleet rather than relying on Raijin and Fujin for their defence
A fleet could lead to taking the Philippines under their rule. Which in turn could lead to trade with SE Asia. And with trade can come intervention.
And my limited knowledge is showing, isn't it...