The domain "locking" you mention doesn't mean it's locked in the way you're thinking about it. To simplify, it's basically just a security feature that most all services provide so some random person/hacker doesn't essentially 'steal' your domain and transfer ownership to themselves and/or to another site.
SquareSpace is your host (where your website files are stored), and NameCheap is your registrar (where your domain is stored). Every domain has what's called "name servers" that tell people's computers where to look to get the contents of your website. Currently, your domains nameservers, controlled over at Namecheap, are pointed to SquareSpace. Think of having name servers like a mailing address, and your house as the host / Squarespace.
So, all you need to do is log into Namecheap (your registrar), and do the find your domain (usually on the left), and click manage next to the domain you want to edit, and under "name servers" just put in the new address of your new host (they'll look something like 'NS21.DOMAINCONTROL.COM' or some sort of variety of it).
You'll need your name servers at your new hosting company first though to be able to type those in and those are usually provided in an email when you sign up for hosting at most places.
Update: If you're looking to transfer your registrar which is SquareSpace to somewhere else, know that you have to wait 60 days after registering a new domain and the transfer process can take a week.
After that, the process is similar for most places, but with SquareSpace you can go to:
Settings -> Domains -> Uncheck Domain Locking to unloock the domain -> Click Get Transfer Key and copy that code down. Now you can go to NameCheap and transfer in that domain by Changing Ownership there.
Hope this helps, and let me know in the comments if any part seems confusing.