Charging batteries in parallel when they are connected in series in the circuit
simulate this circuit &ndash; Schematic created using CircuitLab

Here's one circuit you could use to switch from series to parallel. Check that both switches are break-before-make or there could be sparks. The diode protects the charger if the batteries are switched into series. This will waste a little power, but it should still leave about 4.3V which is plenty for charging the cells in parallel. You could get a bit fancier with a 5V relay if you want, which would mean no external switch is required at all. I wouldn't bother with mosfets because they would increase the component count unnecessarily and require a higher gate voltage than you have at hand for high-side switching.