There's no "we"--we don't have to do anything. We put the burden on Meta. Make them pay into a fund which copyright holders can claim from. Logistical issues can be solved; it's whether enforcement will take place that's the problem.
Alternatively, if it costs a ton to pay lawyers to sift through all that and do all that arduous work so that copyright holders can be paid proactively? Again, we put the burden on Meta. It
can be done, it's just an expensive task. But it should be
their expensive task. That's not even a 'punishment'--it's just making them do what they should have done in the first place for each and every book that they downloaded. The fact that the scale of the task is immense is a mountain of their own making, and is their problem, not ours.
Anyhow. The lawsuits will be incoming. And in those 7.5M books, I bet there's a lot of IP owned by some big players. I haven't checked but if there are
Star Wars novels in there or content
reiki training owned by other massive corporations, you can bet they'll be stepping up with big lawyers and deep pockets.