אמר הרב הקדוש בעל שם טוב דיש שני בחינות בענין העבירות, הא' כשגדול הדור מהרהר בעבירה מזה נמשך להמון העם שיבואו לידי מעשה ח"ו, הב' הוא להיפך, שמחמת שהמון העם התחילו לחטוא במעשה מזה ממשיכין הרהור בגדול הדור לפעמים, ונפקותא בזה, דלבחינה הא' אין בכח הגדול להתפלל בעדם כיון שממנו נצמח הרעה, אבל לבחינה הב', אם כן הגדול הדור הוא אנוס ותפלתו רצוייה, וזהו שאמר משה, ועתה אם תשא חטאתם, היינו, ועתה אם תשא דהיינו שתמחול להם אם כן יודע אני שהוא חטאתם, דהיינו שהם בעצמם חטאו, ואם אין, שאינך מרצה להם, אם כן אין תפלתי רצוייה ואפשר ח"ו שהרהור שלי גרם זאת אם כן מחני נא, ויאמר ה' אל משה וגו': (גנזי יוסף פ' תשא).
There are two aspects of sin. The first is when the leader of the generation has a sinful thought, which causes the general populace to sin, G-d forbid. The second is when the people sin, which can, at times, cause the leader of the generation to have sinful thoughts.
The difference between them is that in the first case, the leader cannot pray on behalf of the people, since the evil started with him. In the second case, the leader was compelled [by the people], and his prayers are still efficacious.
This is what Moses said: “And now, if You will forgive their sin” – that is, if You forgive them [on account of his prayers], then I will know that it is their sin, that they committed themselves. “And if not” – if You do not forgive them and my prayers are not accepted, then it is possible that my own thoughts are the cause. Therefore, “erase me, please.” Thus, the verse continues: “And the L-rd said to Moses: 'Whoever has sinned against Me, him will I erase from My book.”
Imrei Tzaddikim in the name of the Kedushas Levi