For your knee: Start with low impact exercises. Walking, stretching, swimming. Gradually build up to direct exercising like squats, jogging, lunges, etc. If you have a saddle on a stand, sit in it and practice 2-point in your stirrups.
As for your posture, you just have to remind yourself to sit up.
Think of it this way. At first it's going to seem like a lot of work and hurt. But over time, you'll start to feel better, breathe better, less stress on your spine, your riding will improve once you get back to that.
What helps me with mine is standing with a book (light book) on my head and bending my knees and going down as far as you can and trying to touch the floor with my fingertips. The goal is to go down and up without losing the book but you can start out just reaching down and up, then going down a bit, then some more, etc. Expand to walking with the book and standing on one leg, switching legs, lunging with a book on your head.
Also I put a sausage shaped pillow at the small of my back to encourage me to sit up tall.
"Strength is the ability to use a muscle without tension"