How did modernization cause Japan to become and imperialist power