I am going to give you a very powerful tip today and it will not take me very much time to explain it. It is very important though. Here is a bit of background first.
I grew up playing classical music. I am thankful for the teachers I had but they were all very much part of the piano pedagogy system that has been taught for better or worse for the last century. Consequently, looking back, I see the weakness of it. Improvisation is not taught in that system; technique is the focus. The goal is that system is to help pianists replicate classical music as well as possible.
Like I said, there is good and bad in that approach and I wouldn’t discard it entirely but I am not a huge fan either. Real world music is not about replicating classical music; it is more about things like playing by ear and improvising while playing for church, parties and other events.
If you want an example of how that approach teaches technique at the expense of improvisation, consider the way scales are taught. Students are taught to play major scales but the focus is all about fingering, consistency and speed. In other words, the focus is on technique. The brain is never really engaged; really what is being taught is muscle memory. That kind of practice is helpful when students are replicating classical music because you don’t really have to understand classical music to replicate it. You just have to replicate it as well as possible.
Frankly, I think practicing scales that way is flawed but it is very easy to fix. Here is all you have to do. When you learn scales, go ahead and learn your finger numbers and learn to play fast and consistently. But also take the time to learn the scale degrees. For example, you want to learn that in the key of D, D is 1, E is 2, F# is 3, G is 4, etc.
Learning scale degrees is immensely important to improvisation because it helps pianists name chords and the notes that belong to those chords. For example, if you know that F# is the 3rd degree of a D scale, it is easy to know that a iii (3) chord in the key of D is F# minor.
If you do take the time to learn the scale degrees to all 12 keys and can identify them instinctively and quickly, it will help your ability to improvise immensely. There is absolutely no doubt about it. So make the commitment to turn on your brain when practicing scales rather than just letting your muscles take over. That modest investment will benefit you the rest of your life.