Similar Items: Characterizing the Expressivity of Local Attention in Transformers