It's called: wikipedia.org/wiki/Psychological_projection
("Psychological projection is a theory in psychology in which humans defend themselves against their own unconscious impulses or qualities (both positive and negative) by denying their existence in themselves while attributing them to others. For example, a person who is habitually intolerant may constantly accuse other people of being intolerant. It incorporates blame shifting.")