It is implemented in class \TYPO3\CMS\Recordlist\LinkHandler\PageLinkHandler of the system extension recordlist. The class is marked as @internal and contains neither hooks nor events.

The PageLinkHandler is preconfigured in the page TSconfig as:

TCEMAIN.linkHandler {
page {

TCEMAIN.linkHandler.page.configuration.pageIdSelector.enabled = 1