how to have a project on a different location that its library in FCPX
As far as I know FCPX is not excepting external USB to work on your project. It has to be an internal or external drive. You certainly can move the project to an USB when you finish or to transfer between computers.

I also would not recommend to have your media on an USB for performance reasons as well.