As Josh says, Learning Guitar by hearing will have some helpful advice for you.
To extend it to piano, I think there are two core skills to learn:
Fitting chords to melodies
You can practice this by just playing triads as you hum a tune, or play triads with your left hand while playing the tune with your right.
Many, many tunes - from classical standards to rock, pop etc. - fit the "three chord trick" of the tonic chord, the major 4th and the major 5th. Try to get these chord sequences by ear. You can cheat by looking at a chord sheet to see whether there are other chords in there, but having done that, don't look at the sheet. When you can do three-chord songs, move on to more complicated ones. You'll start to spot common transitions.
Practice in lots of keys too. Try it in each of the white-key-root major keys, at least.
Interesting rhythm patterns
Although it's a good basis, triads being plonked out on the downbeats aren't very musically pleasing. You need to play more interesting patterns.
A simple and classic example is to play up-and-down arpeggios.
Another example is to play a root-chord-fifth-chord oom-pah-oom-pah pattern.
... and many more; copy the ones you like. If boogie-woogie is your thing, there are many books on it.
Listen to music you like, and pay attention to what the backing is doing -- it doesn't matter whether it's piano music or not; think about how you could get a similar feel from a piano accompaniment.
When playing from a score, don't just blindly play the notes. Analyse how the notes on the page correspond to a chord progression, and how you could steal that pattern and apply it to another tune's chord progression.
Try playing "three blind mice" over the triplet-triads accompaniment of Moonlight Sonata!