save screenshots into local file system in blender game engine in python
This is the same code but for the game engine:

from bge import render

render.makeScreenshot('Screenshot#.png')


On Windows 10 you need to run as Admin to be able to save screenshots to the primary disk.