There's a Halloween special, 'Treehouse of Horror XII', one of the segments is 'Wiz Kids'. Mrs. Krabappel is teaching transfiguration, and Lisa, of course, does the best. The evil lord "Montymort" will get in the way, though. There's even a Harry Potter cameo (not affiliated or voiced with anyone from the official books or movies). It's hilarious.
I've seen this episode, "Get in there, defend my honor" classic. When or where this cameo is? I am not sure I've seen an episode resembling harry potter's series except for that brown-haired what's-her-name book.
It's in the part when Mrs. Krabappel starts teaching the transfiguration class. Harry Potter is sitting up front, chewing something and Mrs. Krabappel says, "Harry Potter, is that gum?" and Harry answers, "No, Ma'm, it's brimstone!" LOL