So, for the linear keyframe case it could look like this:
t1 = key(1).time;
t2 = key(2).time;
v1 = key(1).value;
v2 = thisComp.layer("Null 1").effect("Slider Control")("Slider");
linear(time,t1,t2,v1,v2)
Or, you might want to change the last line to this:
easeOut(time,t1,t2,v1,v2)
Hopefully, that gives you the idea.