If you read the wiki page, you'll find that citation [1] is about Roman and Germanic law, and citation [2] is a dictionary. Neither of which are relevant to this case.
But even if your definition were relevant, Elon Musk did not commit treason because he is not a Ukrainian citizen, and owes no allegiance to them.
Elon Musk has US citizenship. But under US law, this isn't treason either. Treason is defined in the constitution as "levying war against the U.S." not the case here, or "or adhering to their enemies, giving them aid and comfort."
You could argue this rises to the level of aid or comfort, but Russia is not an enemy in the eyes of the constitution. They would have to engage in open hostilities for that to be the case. The war in Ukraine is not open hostility against the US.
I'm not a lawyer, but I can do better research than copying the first paragraph from the first searh result.
Treason is a serious crime STOP diminishing that word by misusing it.