godnotgod
Thou art That
No, not illegitimate in the least, unless you know of some written codes from back then that detail marriage laws.
Sarah was Abraham's lawful wife; Hagar was not. Isn't that enough? Weren't the vows of husband/wife violated? I don't know of any codes that said it was OK for a married man to have sex with another woman, unless it was a polygamous marriage.