As you know, a voltmeter connected directly to the source of current shows not the e.m.f but the potential at the source's terminals
V = E - Ir
where r is the internal resistance of the source. Since r is unknown, it is not possible to determine the e.m.f from the readings of the voltmeter and ammeter with the sliding contact of the rheostat in only one position. But if the sliding contact is moved and the current and potential difference are measured for this new position then we shall obtain the self-evident equation
E = V1 + I1r = V2 + I2r.
Hence
r = (V1 - V2)/(I2 - I1)
and the unknown e.m.f.
E = V1 + I1r = V1 + I1(V1 - V2)/(I2 - I1).