Raymond Franz' troubles began with his objection to this type of thing. He even had the temerity to hide an article on "legalism" in the Awake in 1979 (assumed, given the apparent parallels with his book "In Search of Christian Freedom").
It is noteworthy that the word "legalism" (self-righteousness attained by following the "right" rules) appears only once in the entire 2010 Watchtower library (besides a second index reference), but 1,780,000 times on the internet according to Google.
"Moralism" (self-righteousness attained by following the "right" morals) does not appear even once in the 2010 Watchtower library, but 884,000 times on the internet according to Google.
Only 4 short references to "ethnocentrism" (self-righteousness attained by following the "right" doctrines) appear in the 2010 Watchtower library, but is referred to 950,000 times on the internet according to Google.
Some of the 39 references to "Gnosticism" (self-righteousness attained by following the "right" knowledge) in the 2010 Watchtower library, clearly do apply to the Watchtower Sanhedrin (Governing Body) and Watchtower Pharisees (ruling religious hierarchy), although the Watchtower carefully avoids making such application. "Gnosticism" is referred to 1,880,000 times on the internet according to Google.
There are a number of instances of words such as legalistic, moralistic, ethnocentric, and Gnostic in the Watchtower library.
These are all blatant apostasy (spiritual unfaithfulness or prostitution) according to Paul's often repeated take on IMPUTED righteousness (aka Justification - being declared or counted as righteous on the basis of receiving the free gift of faith, and not on the basis of any supposed merit).
Watchtower religionists make a practice of ignoring the inconvenient reminder in Proverbs 17:15: "Acquitting the guilty and condemning the innocent--the LORD detests them both".