We've chosen the coordinate systems as shown. Note that it is perfectly consistent to use two separate coordinate systems for the different masses. Keep this point in the back of your mind when you go through this problem. Do you notice anything illegitimate?
Let's look at the first mass. We'll denote its acceleration by .
We have or
The decomposition into components for the weight is the same as in section 1.5.1. See eq. 1.6. So there are two forces acting in the y direction. The weight has a component in this direction and the normal force entirely in this direction. The acceleration in the y direction is zero, since the block is sliding along the x direction. So the y component of the above 1.19 is the same as Eq. 1.9 which says
The y component is
But we also know that . Putting this all together, the y equation becomes
Now on to block 2. Here all the action occurs in the y direction, We have
Now let's size up the situation here. We have two equations 1.21 and 1.23. They contain three unknowns, the tension, and the two accelerations. So we can't solve for these uniquely without some extra info. Aren't we missing something? As things stand now, we haven't said there's any relation between the two acceleration. But clearly they closely related. If the first mass goes down the plane one inch, the second mass must go up the same amount. So the accelerations are equal and opposite (think about the coordinate systems we're using)