Hi, Efficient Eagle. That's an excellent question.
Once you know the acceleration of blocks m1 and m2, simply calculate the resultant force that causes the acceleration of m2 using the equation
F = ma
to find the force m1 exerts on m2.
Have a nice evening!
Pic Rapide