Towards Knowledge Checking in Retrieval-augmented Generation: A Representation Perspective