I am not sure it is illegal. I think it may depend on how much older the other party was.
Also, how long ago did this happen.
My standard disclaimer: I am not offering legal advice, assume I do not know the law in your state and that I am just making suggestions for starting points for when you do speak with an attorney. Do NOT rely on anything I write and contact a lawyer in your area immediately after reading my posting.
Mr. Waggoner is absolutely correct on this one regarding the age of the boyfriend. I might add that unless your mother has other evidence of the alleged sexual relationship (i.e., your boyfriend testifying against you or her actually witnessing the sexual relationship), your statements in the diary could be excluded from trial under the corpus delecti rule. It doesn't sound like you have much to worry about, especially if your guy was under 24 at the time.