Let us apply a simple test for aromaticity. Replace the carbonyl group with bonds to two methyl groups. Now you will still have six pi-electrons in a generally planar structure. Will this structure meet the rules for aromaticity? The answer should be it does not. This would explain the statement in the textbook.
If one were to include the electrons of the carbonyl group in the calculation, then the total would be 8 pi-electrons, also not aromatic.
I had not wanted to jump in here as I had earlier made the same argument as noted by spirochete. I would say that even though the textbook may say it breaks aromaticity, it may not necessarily be so. The pKa of pyrrole is also increased compared to pyrrolidine. If you carefully analyze the structure, you will find the anion (H-N) electrons are orthogonal to the pi-electrons of the pyrrole ring. That is, the electron withdrawing properties of the sp2-carbons can increase the acidity of the OH or NH-group without invoking resonance structures. I grant that resonance structures can be written and this explanation predominates in organic chemistry.