In general, this is something that you'll improve at naturally when you work on teams or maintain legacy code (assuming a relatively good codebase). One thing that can be super-helpful is to review a good codebase and see how features are implemented and think about why it was done this way and how you would have done it (for python, take a look at the flask or django codebase and see how they use abstractions). And honestly keep interviewing.