To get a copy of a W-2 from Social Security https://faq.ssa.gov/en-us/Topic/article/KA-02501
https://www.irs.gov/help-resources/tools-faqs/faqs-for-individuals/frequently-asked-tax-questions-answers/irs-procedures/transcript-or-copy-of-form-w-2/transcript-or-copy-of-form-w-2
You can get a wage and income transcript from the IRS: It will not show the actual W-2, 1099’s, etc, but will show the income information the IRS received. It will not, however, show your state information. It will only show the federal information.
https://www.irs.gov/individuals/get-transcript