  In this paper, we take advantage of the averaging theory to investigate a
torus bifurcation in two-parameter families of 2D nonautonomous differential
equations. Our strategy consists in looking for generic conditions on the
averaged functions that ensure the existence of a curve in the parameter space
characterized by a Neimark-Sacker bifurcation in the corresponding Poincar\'{e}
map. A Neimark-Sacker bifurcation for planar maps consists in the birth of an
invariant closed curve from a fixed point, as the fixed point changes
stability. In addition, we apply our results to study a torus bifurcation in a
family of 3D vector fields.
