Keratohyalin granules are formed during the differentiation of keratinocytes as they move from the stratum spinosum to the stratum granulosum. During this process, keratinocytes undergo a series of transformations, including the synthesis of keratin and the accumulation of keratohyalin granule proteins. The granules become visible under a microscope as the cells reach the stratum granulosum.