We consider a mechanical system consisting of $n$ penduli and a $d$-dimensional generalized rotator subject to a time-dependent perturbation. The perturbation is not assumed to be either Hamiltonian, or periodic or quasi-periodic. The strength of the perturbation is given by a parameter $\epsilon\in\mathbb{R}$. For all $|\epsilon|$ sufficiently small, the augmented flow has a $(2d + 1)$-dimensional normally hyperbolic locally invariant manifold $\tilde\Lambda_\epsilon$. We define a Melnikov vector, which gives the first order expansion of the displacement of the stable and unstable manifolds of $\tilde\Lambda_0$ under the perturbation. We provide an explicit formula for the Melnikov vector in terms of convergent improper integrals of the perturbation along homoclinic orbits of the unperturbed system. We show that if the perturbation satisfies some explicit non-degeneracy conditions, then the stable and unstable manifolds of $\tilde\Lambda_\epsilon$, $W^s(\tilde\Lambda_\epsilon)$ and $W^u(\tilde\Lambda_\epsilon)$, respectively, intersect along a transverse homoclinic manifold, and, moreover, the splitting of $W^s(\tilde\Lambda_\epsilon)$ and $W^u(\tilde\Lambda_\epsilon)$ can be explicitly computed, up to the first order, in terms of the Melnikov vector. This implies that the excursions along some homoclinic trajectories yield a non-trivial increase of order $O(\epsilon)$ in the action variables of the rotator, for all sufficiently small perturbations. The formulas that we obtain are independent of the unperturbed motions and give, at the same time, the effects on periodic, quasi-periodic, or general orbits. When the perturbation is Hamiltonian, we express the effects of the perturbation, up to the first order, in terms of a Melnikov potential. In addition, if the perturbation is periodic, we obtain that the non-degeneracy conditions on the Melnikov potential are generic.