Pretty straightforward: to say that someone has done something unlawful, is it a “legal transgression” or “illegal transgression?”
Breaking the law seems to be both a “legal transgression” and an “illegal transgression” though the latter seems redundant.
Going by popularity a google search of “legal transgression” yields 3000 hits, and “illegal transgression” yields 225 hits.
If it were up to me I would simply use “crime” instead.