I don't know if you are looking for a quote specifically from the Baal Shem Tov, but there are numerous sources that bring this idea - and it is quite a widely discussed Chassidish concept.
The closest to the Baal Shem Tov I could find is his main disciple - Rav Dov Ber of Mezeritch who brings it in his Maggid Devara Le'Yaakov,29:
וזהו מיין שהוא שמחה כנ"ל שהוא המחשבה אותיות בשמחה.
However, the Kedushas Levi also brings it down in Parshas Vayeira here and writes:
והנה מחשבה אותיות בשמחה ומחשבה היא ראשונה ותמידיות וכשאדם בא לאין ומדבק עצמו במקור החיים ואז שופע עליו חיות ואז בא לעולם התמורה ומעלה אותו לאדון הכל להיות הכל דבוק בהשם יתברך חי וקיים לעד וזהו סוד והיה הוא ותמורתו יהיה קודש (ויקרא כז, י)
It is significant that the letters in the word מחשבה, “thought,” are the same as in the word בשמחה, "with joy”. מחשבה is an attribute that is both primary and constant. If a person reduces himself to the אין, negating all interest in the physical part of the world, having done this he is able to attach himself to the source of all “Life.” When this has occurred, a new “LIFE” is bestowed on him, a life in a different world, one in which he is elevated to be close to Eternal G’d. This concept is portrayed in the Torah in Leviticus 27,10 where the subject is the person who donates to הקדש, G’d’s representative on earth, his “net worth,” as defined according to his age. Having done so, the Torah there describes him as והיה הוא ותמורתו יהיה קודש, “then both he and his substitute will be holy.” (Sefaria translation and additional notation).
Also refer to the Beis Aharon of Karlin here as well as HaRav Moshe Chaim Ephraim of Sudilkov (grandson of the Baal Shem Tov) in the Degel Machaneh Ephraim here.
Similarly, the Ben Ish Chai brings the concept on Behalosecha and likewise says:
לזה אמר הכתוב (קהלת ט, ז) "לך אכול בשמחה לחמך ושתה בלב טוב ייניך כי כבר רצה האלהים את מעשיך", והיינו בשמחה אותיות מחשבה ואמר על ידי המחשבה וע"י לב טוב שהוא הכונה רצה האלהים את מעשיך, כי מעשה לבדה בלתי צירוף כונה ומחשבה אינה עולה לרצון
This is what the verse says (Koheles 9:7) "Go, eat your bread in gladness, and drink your wine in joy; for your action was long ago approved by G-d." And the the word "with joy is the same letters as "with thought". And it is said by thought and by a good heart that the intention is that G-d wanted your deeds because an act alone without a combination of sincerity and thought does not ascend to one's will."