Another way is on your first layer take the rounded rectangle tool and make the box, and then on each layer after it create a clipping mask.
I didn't try this before, but the way I posted is fairly easy once you get used to it. I have doing it for a while now, my hand automatically do the job now without even thinking.
Oops, i forgot about printscreen, silly me. thanks Zeldy.