I'm trying to formulate and prove Theorema Egregium for a 2-dimensional surface embedded in $\mathbb{R}^n$ with $n>3$. (The motivation is that I would like to understand sectional curvature in a more intuitive way.)
More precisely, I approached the problem in the following way: I pick a geodesic that passes a point $p$. I can then calculate the geodesic curvature for each direction on the tangent space, and define the product of the smallest and largest curvatures as the Gaussian curvature at $p$.
But I encountered a problem: the geodesic curvature I defined in this way doesn't have a sign, and since there is no well-defined normal vector to the surface (because codimension > 1), I don't know how to properly define the geodesic curvature with a sign.
I doubt now if such a Theorema Egregium for $\mathbb{R}^n$ with $n>3$ even exists. Perhaps the geodesic curvature for geodesics in higher-dimensional space is not related to Gaussian curvature in the same way as in $\mathbb{R}^3$?
$\newcommand\R{\mathbb{R}}$First, you talk about the geodesic curvature of a geodesic, but the geodesic curvature of a geodesic is zero. I believe what you have in mind is called the normal curvature.
In particular, if $S$ is a smooth surface in $\R^n$ and $c: I \rightarrow S$ is a smooth curve parameterized by arclength, then the acceleration of $c$ has an orthogonal decomposition $$ c'' = \kappa_g e_2 + \kappa_n e_3, $$ where $e_2$ is tangent to $S$ but normal to $c'$ and $e_3$ is normal to $S$. $\kappa_g$ is called the geodesic curvature and is the curvature of $c$ viewed as a curve in the Riemannian $2$-manifold $S$. $\kappa_n$ is called the normal curvature of $c$ relative to $S$. The curvature of $c$ as a curve in $\R^n$ is given by $$ \kappa = \sqrt{\kappa_g^2+\kappa_n^2}. $$
If $c$ is a geodesic on $S$, then $\kappa_g = 0$, and therefore the curvature of $c$ as a curve in $\R^n$ is $$ \kappa = |\kappa_n|. $$
$\newcommand\II{\operatorname{II}}$ When $n = 3$, $e_3$ is uniquely determined up to sign and $$ \kappa_n = A(c',c'), $$ where $A$ is the second fundamental form. However, there is an ambiguity in the sign of $A$ depending the choice of $e_3$. Note, however, that $$ \kappa_n e_3 = A(c',c')e_3 $$ does not depend on the sign of $e_3$.
If $n > 3$, then, since there is no normal vector that is unique up to sign, the second fundamental form cannot be written as a symmetric bilinear function. It can, however, be defined to be the map $$ \II_p: T_pS\times T_pS \rightarrow N_pS,$$ where if $c$ is a unit speed geodesic through $p$, then $$ \II(c',c') = c''. $$ Here, $N_pS$ consists of all vectors in $\R^n$ that are normal to $T_pS$.
Therefore, if you know the acceleration vector of every unit speed geodesic passing through $p$, you know the second fundamental form $\II$ at $p$.
The Theorem Egregium for a surface $S \subset \R^n$ can now be stated as follows: If at $p \in S$, $(e_1,e_2)$ is an orthonormal basis of $T_pS$, then the Gauss curvature at $S$ is $$ K = \II(e_1,e_1)\cdot \II(e_2,e_2) - \II(e_1,e_2)\cdot \II(e_1,e_2). $$ The easiest way to prove this is to using an orthonormal moving frame and compute using differential forms.