So, as you allow, let's assume characteristic zero and perhaps even working over $\mathbb C$? It seems to me that Graber-Harris-Mazur-Starr gives you at least a necessary condition. Jason might correct me if this is wrong, or add something in the other direction.
Anyway, GHMS introduces the notion of a pseudosection which is a subvariety $Z\subseteq X$ that dominates the base with a rationally connected general fiber and they prove (essentially) that the existence of a pseudosection is equivalent to $f$ admitting a section after a base change to the normalization of any curve in the base. As mentioned in the comments, over a smooth curve the existence of a section follows from the general fiber being rationally connected by an earlier result of Graber-Harris-Starr.
So, I would proceed as follows: Suppose there exists a section over $U$, a Zariski open subset of $Y$. Restrict $f$ to $U$ and observe that the section of $f\big|_U$ implies that any further base change to a smooth curve admits a section. Then by GHMS this $f\big|_U$ admits a pseudosection. Take the closure of this pseudosection in the original $X$. This closure will be a pseudosection of the original $f$.
In other words, if $f$ admits a generic section as you require, then it admits a pseudosection. This shows for example why your example does not admit a generic section (not that you need this condition, I'm just saying that it does imply that).
So, the remaining question is whether having a pseudosection is enough for admitting a generic section. Clearly it is enough over a curve by [GHS]. I don't think it is enough in general and I think it is possible that the exact condition that would be needed here is not known. Again, I defer to Jason to possibly comment on this.