\textit{In-situ} pseudopotentials for electronic structure theory