I believe it's a mind thing, unless you have unusually poor balance. As long as you have some speed, the bike wants to stay upright and move forward.
A couple years ago I decided I needed to be able to let go on rollers, just to vary my position. It turns out that's not so hard either, as long as you keep pedaling. Stop for even a second or two and it's bad news.