Here we will be almost copying the proof of Theorem 8.18 (Bertini's theorem), Chapter II from Algebraic Geometry by Hartshorne.
Let us assume that the base field is $k$ and it is algebraically closed. Let $V_n = \Gamma(Y, G(n))$. Consider the evaluation map
$$\varphi_x : \wedge^p V_n \rightarrow \wedge^p G(n)_y,$$
where $y \in X$ and $G(n)_y$ is the notation for $G(n)_y/m_yG(n)_y$. We choose $n$ large enough so that $V_n$ generates $G(n)$, this implies in particular that $\varphi_x$ is surjective. Hence $\dim(\ker \varphi_x) = \dim \wedge^p V_n - \text{rk} \wedge^p G$. Define
$$B := \lbrace (x, v_1 \wedge \dots \wedge v_p) \in Y \times \mathbb{P}(V_n) \big| \text{ such that } \varphi_x(v_1 \wedge \dots \wedge v_p) = 0 \rbrace.$$
It is not difficult to see that these are the closed points of a Zariski closed set to which we give the induced reduced subscheme structure. The composite map
$$B \hookrightarrow Y \times \mathbb{P}(V_n) \rightarrow Y$$
is surjective with fibers having dimension $\dim(\ker \varphi_x) - 1$. Hence the dimension of the reduced noetherian scheme whose closed points is $B$ can be seen to be
$$\dim(\wedge^p V_n) - \binom{q+p}{p} - 1 + p.$$
This is strictly less than $\dim(\mathbb{P}(\wedge^p V_n))$ for any $p > 0$. We get that there exists $v_1, v_2, \dots, v_p \in V_n$ such that $\varphi_x(v_1 \wedge \dots \wedge v_p) \neq 0$ for any $x \in X(k)$. In particular it implies that $v_1, v_2, \dots, v_p$ are linearly independent sections of $G(n)$. This directly implies the existence of an injective map $\mathcal{O}^p_X \rightarrow G(n)$.