I've read Toby Wilkinson's "Rise and fall of Ancient Egypt". He mentions that whenever a pharaoh obtained his power in "shady" way (not inherited), he had to shower priests with gifts to create some theological propaganda that says that the new ruler is indeed a god, not an usurper.
While there are plenty "sacred texts" preserved, the priests had to know that all the religion is just bullshit to control the masses. And they had to learn and study the "craft" of such propaganda.
To be a good propagandist you have to know the psychology, sociology, memes etc.
Are there any texts preserved, that allowed an inexperienced priest to study such topics to become a proficient bullshit peddler?
Not as such, but the Egyptians did write wisdom texts and muse about the qualities that make a good ruler. I discussed this in Are there any texts of political philosophy from Ancient Egypt?