A transfer principle for second-order arithmetic, and applications. (2018)