When a player tries to take a book from a lectern an event should be called.
I think the best matching event is the InventoryClickEvent with a new InventoryAction MOVE_TO_OTHER_INVENTORY_OR_DROP - Because unlike other inventory actions this action will drop the stack if there is no free space in the players inventory.
I will create a PR for this.
Attached is an example plugin that does some debug output for the InventoryClickEvent and allows to cancel it. To toggle the cancelling, execute /togglebooktake