How to control a motor if it is supplied power via an external power supply?

NO, please don't do that. I'm going to cry. You buy a male to male header and some female headers and break off 3pins and make a
ribbon cable to plug into the servo connector using a 3-pin male to male header at that end and whatever you want at the other end. If you can't solder you can buy male servo cables at a hobby store or order them online.