If you saw it in a book, you should provide the context to get an exact answer. Some examples:
Marijuana’s legal here now, but when I was young some of my classmates enjoyed it illicitly. (They used it illegally. ‘Enjoy’ suggests that they perceived it as a positive)
‘Illicit’ can also be figurative.
My doctor doesn’t want me to eat junk food, but since it’s my birthday I figure I’m entitled to enjoy it illicitly. (Against the rules given by the doctor)