18650, charge and supply at the same time
Turning the switch on and off is fine, all this does is add a load to whatever source is a higher voltage, be it the charger or the battery. The way this setup will work is that the boost converter will attempt to reach it's programmed output voltage and fail if the cells are below it. The boost converter will then instead reach it's maximum duty cycle and begin to charge the battery, which may or may not upset your USB ports maximum current limit depending on the boost converter used. An inline resistor between the boost and cells is a simple fix for this problem. Alternatively you might can find a boost converter that has a low enough output current to avoid this. The truly correct way to go about it would be to put a charger IC/module between the USB boost supply and the battery pack.