With improvisation learning passes from freedom to order. This is the precise opposite of the whole of formal education and what we are used to. By far the worst obstruction to learning improvisation is inhibition, and a habituated concern with "ought tos" and "shoulds". Flow must occur first, prior to any assessment of quality. Therefore initially the actual material is best kept very simple. For example one way is to take just two or three scales and play any phrases and rhythms within them in uninterrupted flow. Something like that gives infinite scope for invention, no requirement for mental arithmetic, and if it is in one scale it must sound all right in the conventional sense.
Yes, a teacher is good. Trouble is, hardly any trained musicians or piano teachers can improvise themselves except the odd one or two who are restricted to jazz.