The best answer to how scholars know that Indo-Aryans raised cattle and depended upon their milk, but later turned to agriculture is:
The Vedas provide a record of how the Indo-Aryans lived.
The Vedas are ancient texts that contain hymns, prayers, and descriptions of ritual practices that provide insight into the lifestyle and beliefs of the Indo-Aryans, including their agricultural practices and domestication of animals.