How can I test the maximum safe current I can put through an electrical switch?
You can test a switch for the maximum current it can handle, but then you'd have to get a new one to actually use.

Look carefully at the switch.  Often such values are stamped right on it, especially for large toggle switches.  If you can find the model number, then you can look up what the rating is.

Otherwise, you can get a start by measuring the current it switches in its intended operation.  If the circuit was designed properly, that should be at least a bit less than the full rating.

If you don't know and don't want to take a chance overloading the switch, then you can have it turn on a relay, then have that relay do the actual switching.  Relays to switch 4 A should only take a few 10s of mA at 5 V.

Or, you can replace the existing switch entirely with a part you of known specs.