Involved in the biosynthesis of forosamine ((4-dimethylamino)-2,3,4,6-tetradeoxy-alpha-D-threo-hexopyranose), a highly deoxygenated sugar component of several bioactive natural products such as the insecticidal spinosyns A and D. Catalyzes the dimethylation of the C-4 amino group from dTDP-4-amino-2,3,4,6-tetradeoxy-alpha-D-glucose to yield dTDP-D-forosamine