The start's temperature change can be regarded as getting hotter and hotter by each transformation or stage in the star aging. As the star ages from a main sequence star to a red giant, then the temperature would rise higher. It would rise even higher if it goes from a red giant to a white dwarf because a white star is hotter than a red one.