In this case, "illegal" could be interpreted as "contrary to international law" - though I'm not a lawyer and couldn't quote the relevant law chapter and verse.
I personally think a moral difference exists between say the Allied invasion of Sicily in '43 and the Putin invasions of Ukraine - so we do need some word to highlight this difference. I believe "illegal" works well enough for this purpose.