The shift solenoids are in the transmission, attached to the valve body. They control the shifting of the transmission, so the answer is yes, they can cause the problem you are having, however the possibility of both solenoids failing seems unlikely, it's more likely the power supply to the solenoids is incorrect. You'll need to perform the diagnostic procedures associated with the two codes to determine the problem.
Pontiac has several technical service bulletins related to shifting issues, I strongly recommend you check into these, or have your repair shop do so before replacing any parts.
Good luck, let us know what you find!