Language Models Can Learn Exceptions to Syntactic Rules