To accomplish this, we would need the Kaiser to be less hung up about Yellow Peril, Germany not joining the Triple Intervention, and Japanese support in establishing German territorial concessions in China. The alliance would be against France and Russia but not against Britain. From what I researched, such an alliance wouldn't affect Anglo-Japanese relations much because the alliance and Britain's common foe is Russia; though, Anglo-Japanese naval cooperation wouldn't be as strong as OTL because of Germany. The IJN wouldn't be as great ITTL but the IJA would be better. With that in mind, things would probably go better for the IJA during the Russo-Japanese War because Germany was able to train them more, but not for the IJN, which probably loses. To establish the Anglo-Japanese Alliance afterwards, Japan would either have to dump Germany for Britain after the Russo-Japanese War or suffer a crushing defeat in World War I. The former would be most plausible because with Japanese land victories, Britain and Japan would fear Russian domination of Asia. As for World War I, that's tough. The Zimmerman Telegram proposed to Mexico that they mediate between Germany and Japan and that all three nations form an anti-American alliance (but they mentioned nothing about the UK). With the IJN sympathetic to the UK, Japan would avoid fighting the British but would gladly fight the French and the Americans. German-Japanese expeditions to French Indochina and the Philippines? Japan would only have to fight the UK if they needed to bail the Germans out in in Tsingtao. I don't see the Anglo-Japanese Alliance coming about after that unless the Entente wants to keep Japan as a check on the Soviet Union.