The Co-op has apologised after hackers managed to access the data of a "significant number" of past and current members.