As Cats said, the black box is the holder for the bike's main fuse but I believe the main fuse on CX500s up to 1981 is 20A, not 30.
It would work if you bypassed the main fuse but it is not a very good idea because it is there to protect the wiring, alternator and regulator/rectifier from excessive current if something goes wrong.
The newer type that Mike linked to could be used but you should compare the wiring drawings for the CX500 and the GL500 to figure out how to connect it.
Welcome to the forum. Please add your location and your bike's model and model year to your profile so that you don't have to remember to tell us every time and we don't have to keep asking when you forget (see Forum Settings link in my signature).
And welcome to the world of antique vehicle ownership (they own us, not the other way around). Your bike is about 4 decades old and may or may not have had all of the maintenance necessary to keep it safe & reliable so it is highly recommended to download the Factory Shop Manual for your model (available through the CX Wiki - link in my signature) and go through all of the service procedures, regardless of whether your bike has reached the specified mileage.
Note that while aftermarket shop manuals are pretty much necessary for people without factory training to work on a lot of makes & models of bike the FSMs for the CX/GL500/650 family of bikes are so well written & laid out that the FSM is really the only book you need and and the aftermarket books are secondary references at best.
I also recommend looking on all rubber parts with suspicion because rubber does not age gracefully. Check the date codes on your tires and replace them if they are over 5 years old no matter how good they look & feel (old rubber simply cannot flow around the irregularities in the asphalt well enough to grip, especially if it is cool or wet). The original rubber brake lines should be replaced every 2 or 3 fluid changes (= 5 or 6 years) so if your bike still has them I recommend shopping for modern stainless braided ones (they last practically forever and double the life of the fluid). And don't forget things like the rad hoses and the boot between the engine and swingarm (they can crack on the bottom where you don't see it).
The best advice anyone can give you about customizing any vehicle is to get it safe & reliable in more or less original condition and use it for a while before you start making any changes so that it can tell you what changes are needed to make it do what you want/need better and then putting your time/effort/money into those instead of wasting those precious resources on making changes based on style or on copying what someone else (who may or may not really understand how the changes affect the way it works) has done.
Modifications that actually make it work better not only are more likely to produce something you actually want to keep and use but also something that doesn't look like every other copycat "custom" around. Mods for the sake of style, on the other hand, often result in a piece of expensive yard art that you can't stand sitting on for more than a few minutes and might even be dangerous.
It would work if you bypassed the main fuse but it is not a very good idea because it is there to protect the wiring, alternator and regulator/rectifier from excessive current if something goes wrong.
The newer type that Mike linked to could be used but you should compare the wiring drawings for the CX500 and the GL500 to figure out how to connect it.
Welcome to the forum. Please add your location and your bike's model and model year to your profile so that you don't have to remember to tell us every time and we don't have to keep asking when you forget (see Forum Settings link in my signature).
And welcome to the world of antique vehicle ownership (they own us, not the other way around). Your bike is about 4 decades old and may or may not have had all of the maintenance necessary to keep it safe & reliable so it is highly recommended to download the Factory Shop Manual for your model (available through the CX Wiki - link in my signature) and go through all of the service procedures, regardless of whether your bike has reached the specified mileage.
Note that while aftermarket shop manuals are pretty much necessary for people without factory training to work on a lot of makes & models of bike the FSMs for the CX/GL500/650 family of bikes are so well written & laid out that the FSM is really the only book you need and and the aftermarket books are secondary references at best.
I also recommend looking on all rubber parts with suspicion because rubber does not age gracefully. Check the date codes on your tires and replace them if they are over 5 years old no matter how good they look & feel (old rubber simply cannot flow around the irregularities in the asphalt well enough to grip, especially if it is cool or wet). The original rubber brake lines should be replaced every 2 or 3 fluid changes (= 5 or 6 years) so if your bike still has them I recommend shopping for modern stainless braided ones (they last practically forever and double the life of the fluid). And don't forget things like the rad hoses and the boot between the engine and swingarm (they can crack on the bottom where you don't see it).
The best advice anyone can give you about customizing any vehicle is to get it safe & reliable in more or less original condition and use it for a while before you start making any changes so that it can tell you what changes are needed to make it do what you want/need better and then putting your time/effort/money into those instead of wasting those precious resources on making changes based on style or on copying what someone else (who may or may not really understand how the changes affect the way it works) has done.
Modifications that actually make it work better not only are more likely to produce something you actually want to keep and use but also something that doesn't look like every other copycat "custom" around. Mods for the sake of style, on the other hand, often result in a piece of expensive yard art that you can't stand sitting on for more than a few minutes and might even be dangerous.