You should have received a form from your employer at the time you purchased the stock. This form 3922 is necessary to provide you with information to determine your gain or loss and how much is possible ordinary income and how much is capital gain or loss.
If you don't have this, then you need to obtain this information from your previous employer. The company should also have a stock plan administration web site to provide assistance.
I got something called supplemental tax information, and this has the adjusted cost basis for both ESPP shares and RSU's that i owned when i was a company employee in the past. I used this to fill out the 1099-B details because this shows me the adjusted cost basis.