OP here. Thanks for the advice. We had a break for few months with this pupil and we've just resumed. Things haven't improved. I can't figure out what the problem is. We've tried all kinds of chair heights.
He's a 14-year-old boy, and he also has trouble with his feet: they are all over the place. One is under the chair and the other is under the keys (it's an electric piano). When I point this out and it improves for a while. Same thing with the wrist. It's just that he can't seem to keep his playing position in an ideal state for very long and I don't know what's causing this. Someone here recommended keeping a coin on his hand while playing, seems worth a try to at least fix this thing with the wrist.
I only have a few years of experience of teaching, and being mostly a self-taught player, I find it difficult to notice bad playing postures. I can tell if something is really off, but not necessarily very minute bad habits. I wonder if there's some source (books, videos) where I could study this?
There's a net forward balance that has to be maintained when at the piano that is felt from the forearm, that you need to help feel balanced and connected to the piano at all times. Note, that I said this is felt from the forearm and not the wrist. From that net forward balance, we can still adjust back and forth relative to it to help us move closer to or away from the fallboard as well as gradually adjust the height of the wrist as needed. In speed situations with trills or repeating chords, we can use that back and forth movement like a see-saw to help us out as well. More importantly, it helps us learn how to coordinate the fingers with the rest of the arm rather than getting ahead of it.
It's not a piano video, and exaggerated for effect (and also because she is standing) but it makes this easier to see:
&t=73
In terms of his legs and posture, one should check if he knows how to balance on his sitz bones at all times on the seat and use that as a fulcrum for his torso. Feeling the resistance of the seat against the sitz bones and connecting it with coordinated, rhythmic, musical motion shouldn't be ignored or assumed.