I never actually looked up how it's calculated. But I always assumed it was based on (1) the rate of heat flow from your body to the air due to temperature differential (call it Q1), and (2) the rate of heat flow from your body to the air due to evaporative cooling of your sweat (which would vary with humidity - call it Q2). So Q(t, h) = Q1(t) + Q2(h).
Then, you establish some baseline "normal" humidity, and calculate the heat flux from your body to the air via these two mechanisms at any temperature and "normal" humidity. Q(Tn, Hn) = Q1(Tn) + Q2(Hn). These are your heat index temperatures.
Then when humidity deviates from "normal", it'll increase or decrease the amount of evaporative cooling (Q2 changes).
Q(t, h) = Q1(t) + Q2(h)
Q(Tn, Hn) = Q1(Tn) + Q2(Hn)
So to get a "feels like" heat index, you just set the two rates of heat flow the same (increase or decrease Q1 to compensate for the decrease or increase in Q2).
Q1(t) + Q2(h) = Q1(Tn) + Q2(Hn)
Q1(Tn) = Q1(t) + Q2(h) - Q2(Hn)
So you plug in the actual temp t to find Q1(t), the actual humidity to find Q2(h), subtract the idealized rate of evaporative cooling Q2(Hn). And can solve for Q1(Tn), the idealized "feels like" temperature at which your body would cool at the same speed, or the heat index.
Wind chill would work the same way. The increase in evaporative cooling due to higher airflow over your skin (or a wet bulb thermometer) results in it "feeling like" the actual temperature (Q1) is lower.