From the text:
The pigs now revealed that during the past three months they had taught themselves to read and write from an old spelling book which had belonged to Mr. Jones’ children and which had been thrown on the rubbish heap.
The pigs did not actually work, but directed and supervised the others. With their superior knowledge it was natural that they should assume the leadership.
The pigs had set aside the harnessroom as a headquarters for themselves. Here, in the evenings, they studied blacksmithing, carpentering, and other necessary arts from books which they had brought out of the farmhouse.
As for the pigs, they could already read and write perfectly.