  The second ($v_2$) and third ($v_3$) flow harmonic coefficients of J/$\psi$
mesons are measured at forward rapidity (2.5 $<$ $y$ $<$ 4.0) in Pb-Pb
collisions at $\sqrt{s_{\rm NN}}$ = 5.02 TeV with the ALICE detector at the
LHC. Results are obtained with the scalar product method and reported as a
function of transverse momentum, $p_{\rm{T}}$, for various collision
centralities. A positive value of J/$\psi$ $v_3$ is observed with 3.7$\sigma$
significance. The measurements, compared to those of prompt D$^0$ mesons and
charged particles at mid-rapidity, indicate an ordering with $v_{\rm
n}$(J/$\psi$) $<v_{\rm n}$(D$^0$) $<v_{\rm n}$(h$^\pm$) (n = 2, 3) at low and
intermediate $p_{\rm{T}}$ up to 6 GeV/$c$ and a convergence with
$v_2$(J/$\psi$) $\approx v_2$(D$^0$) $\approx v_2$(h$^\pm$) at high
$p_{\rm{T}}$ above 6-8 GeV/$c$. In semi-central collisions (5-40% and 10-50%
centrality intervals) at intermediate $p_{\rm{T}}$ between 2 and 6 GeV/$c$, the
ratio $v_3/v_2$ of J/$\psi$ mesons is found to be significantly lower
(4.6$\sigma$) with respect to that of charged particles. In addition, the
comparison to the prompt D$^0$-meson ratio in the same $p_{\rm{T}}$ interval
suggests an ordering similar to that of the $v_2$ and $v_3$ coefficients. The
J/$\psi$ $v_2$ coefficient is further studied using the Event Shape Engineering
technique. The obtained results are found to be compatible with the expected
variations of the eccentricity of the initial-state geometry.
