There is no action to do that directly. A workaround is using:
"Wait to Return"
"Get Latest Screenshots"
Do whatever you wanted to do with the screenshots
"Get Variable" pointed to the Magic Variable (Get Latest Screenshots)
"Delete Photos"
You then would run it, switch to whatever you wanted to screenshot and take it/them, then go back to Shortcuts and it'd continue to run.