If you're dating him just for fun and you don't see yourself being with him longer term, then what should you do? Let it roll off your back.
However, if you DO see yourself being with him in the longer run and if you DO think that he might be marriage material or whatever, consider this: his ex-wife will likely be a fixture in his life for a long time just by the nature of her being the mother of his children. It will be unavoidable.
Someone who has gone to the lengths of hiring a private investigator is probably not somebody who's going to divorce easily. She wants to make him pay and she's angry.
What should you do? That's hard to say. There are easy ways for anybody to get into a locked apartment building, usually by following another person in because most people would hold the door for someone. If a PI has found where you live, then the ex-wife knows your name and where you live. Start by double checking all of your social media profiles to make sure that your privacy settings are properly set up. And then go ahead and block her on all of your social media accounts.
As for what to do next beyond that, I'm not sure. Getting legal stuff involved might be an invitation for introducing more drama into your life, not more. Right now, all you know about is the PI. You don't have any evidence of anything else. But knowledge is power, you know, so now that you know the sort of person your boyfriend is dealing with, think long and hard about what you want to do next and then act accordingly.