Optimum design parameters in two-stage thermoelectric generators