Removing DRM from a legally obtained copy is not illegal in itself.
It is technically not illegal to remove the DRM, if the purpose is just to read it and the DRM is not compatible with my reading device. I just still have to honour the lending agreement I made with my local library.