Similar Items: Implicit Representations of Grammaticality in Language Models