Hi!
I think it’s because he works at the Metro Man Museum. The books, I think, were something he was putting away; the cart he was pushing looks like a library cart. Probably the Museum has a collection of Metro Man books.
Metro Man’s main foe is Megamind, so the Metro Man Museum must have a good amount of information on Megamind. And Bernard, working there, would be expected to be knowledgable about all the exhibits. Since he’s an expert on Metro Man, Bernard would probably also be considered an expert on Megamind.
I also think it’s possible that when Roxanne says “you’re an expert on all things Megamind, right?” to ‘Bernard’, she’s talking him up to convince him to go along with her plan.
Bernard might consider himself an expert on Megamind–he clearly thinks he knows enough to recognize Megamind and Megamind’s technology. Really, though, he doesn’t recognize Megamind, or the de-gun!
This is part of the reason I think that published materials on Megamind–like the library books he and Roxanne read–aren’t really very accurate.
If Bernard, who could be expected to have studied Megamind (since he’s studied Metro Man) can’t even correctly identify Megamind and Megamind’s de-gun–well, how much does he really know about Megamind?
Honestly, I think that Roxanne, with her years of close interaction with Megamind, is probably more of an ‘expert on all things Megamind’ than Bernard.