Here is what I remember from school :
1 - Productivity rose in Agriculture thanks to technological advance making less people needed in the countryside 2 - The rate of natural increase rose during the demographic transition 3- Productivity rose in Industry thanks to technological progress making more people needed in the cities.
SO people went from the countryside to the city to live way more difficult lives were the life expectancy was lower.
BUT it seems to me that there is a flaw in this reasoning : if productivity rose in agriculture why did people simply didn't stay in the countryside but to work less ?
For some it was a choice, for others a flight from poverty or oppressive conditions. There had been a rural exodus of some kind since the emergence of towns that were more then agricultural communities - they had to be peopled from somewhere, and from the late Middle Ages their numbers grew despite high mortality, increasingly through immigration from the countryside.
The problem in the classic period of agricultural growth and movement from the countryside is that many weren't landowners, but lived by renting their holding or selling their labour. Farm rents tended to reflect land productivity, and rose with output, while higher productivity per worker was more likely to eliminate a hired labourer's work than to bring a greater wage. So unless you owned land, working less wasn't an option, especially as food prices were rising from the 1740s. Changes in landowning associated with enclosure are also widely assumed to have contributed to the movement by disadvantaging smaller farmers.
Add to that the replacement of rural handicraft production by urban industry, most famously in the case of spinning and later weaving, which had supported both farm and labouring households outside the main seasons of agricultural work until they became concentrated in mills powered by water or later steam: with the latter innovation these became overwhelmingly urban, with easier access to labour and transport facilities.
But there's certainly something in your reasoning: rural wages in England seem to have risen until 1800 while (higher) urban ones appear to have fallen in real terms until around 1830. That could reflect population movement (two million townward migrants in 1760-1830), but logically the movement should have slowed in response, other things being equal. It didn't.
For such a key period a lot remains unknown: Average British income grew by 60% over 1770-1850, but the food consumption of the poor improved little according to contemporary surveys. Where did the growth go? And as you ask, why did people (11 million town-dwellers by the latter date, up from 2 million a century earlier) not only accept it but move to the cities where life was so hard?
Obviously their choices were limited - by poverty or the threat of want, by dwindling employment opportunities or by the loss of land or livelihood. The lure of higher pay may have drawn many only vaguely aware of the city's higher living costs. Others may have sought the challenge of a highly competitive environment where some might prosper while others fell by the wayside. Others simply had nothing else.