99% certain it will be locked to O2. However, you should be able to phone them up and they can issue you with an unlock code. They will charge you for the priviledge though.
You can try inserting any other network's active SIM card inside your Nokia N95 8GB. If the SIM card can be accessed through it, Then your mobile is unlocked. If the SIM card cannot be accessed through it, Then your mobile is network locked and you need to unlock it.
You can get your Nokia N95 8GB unlocked safer and easier using unlock code. The unlock code for your mobile phone can be obtained either from the respective network provider or from any trusted vendor online. Before that you can visit www.mobileunlockguide.com/nokia-n95-8gb . This site provides free unlocking instructions. This could help you understand the unlocking process better.