Sensor to charge battery
It would be far far far better to use an premade LiIon 3S charger that to attempt to implement one yourself.

A 3S LiIon battery MUST NOT have an applied voltage of more than 3 x 4.2V = 12.6V.
It is far better in most cases to limit Vmax to 12V or maybe 12.3V.  

Maximum current is specificed by the battery manufacturer and is often C/2 or C/1. ie either 

C/2 - Ichg_max_mA = battery_mAh capacity /2  or

C - Ichg_max_mA = battery_mAh capacity 

What is your battery capacity in mAh or Ah.
What is the maximum power that your genset will produce?
How does the genset regulate the voltage of its 12V output?