illegal / illicit
Against the law versus not allowed.
Illegal means against the law. Illicit means not allowed, by law or by custom: illicit trade, an illicit affair. An illicit act may be illegal. It may also be only forbidden by a rule or a norm. If the statute is the point, use illegal.
Examples
Useillegal parking
Usean illicit affair
Avoidan illegal affair (If you mean only that it was forbidden, not that a statute banned it.)