Practicing and trying different things helps most when it comes to integration techniques. In many cases I don't think spotting Feymann's technique is easy unless you've seen it done before. The only general tip I can think of is to try finding things which are easy to differentiate. In the given example, it is sensible to consider
$$\int_0^\infty\frac{\sin(x)e^{ax}}{x^2+1}~\mathrm dx,\qquad\int_0^\infty\frac{\sin(ax)}{x^2+1}~\mathrm dx,\qquad\int_0^\infty\frac{\sin(x)}{x^2+a}~\mathrm dx$$
but it is usually less sensible to consider
$$\int_0^\infty\frac{\sin(x)}{x^a+1}~\mathrm dx$$
Incidentally, the first two parameterizations allow your integral to be solved, the third may allow generalizations to denominators of the form $(x^2+a)^n$, and the last doesn't seem very helpful.