Its very simple. Consider the following section of the ciruit,
When the battery is charging, the potential at the point X is increasing, and hence the NPN transistor TIP41’s is getting less forward biased. The resistor 4ohm and 500ohm are so adjusted that when the battery reaches a particular voltage, the NPN forward biasing voltage reaches below cut-off range. At this point the transistor goes to cut-off state and battery charging stops.
I hope this clears your doubt!