When you leave a company with a 401(k) account, they are required to file with the SSA that you have retirement funds. So when you file for Social Security benefits, they will notify you.