If I’m rich enough to employ thousands of people I can hire each one of them to borrow as many books as possible then use all the books to train an AI. Perfectly legal. And also very possible.
Point being that the library prevents you from checking out 500gb because of logistical issues. First how can you carry all those books and how can they let other patrons in the library check out books if you grabbed that many? These rules aren’t enforced to prevent “scale” hence why my methodology got around the rules.
Great! Then it's perfectly legal.
As long as you obtain the books legally then it's legal
This really isn't that hard