It is well known that given a connection on a $\mathbb{K}$ vector bundle $E$ over some manifold $M$ with rank $r$, there is a $U\subset M$ is a framed open set with frame $e= \{ e_i \}_{i=1}^r $, such that we have a connection form matrix $\omega \in \Omega ^1 (U, \text{Mat}_{r\times r}(\mathbb{K})$ with respect to this frame. It satisfies $$ \nabla_X(\tilde{e}_i)=\sum_j \omega^i_j(X)e_j $$ if $\tilde{e}_i$ is a globally defined section that agrees with $e_i$ on $U$. I understand that given a vector bundle, we can always find framed open sets in which we can define the connection locally.
Now, my question is given a connection and a framed open set, can we always have a connection form with respect to this frame (we of course still have connection via restriction of $\nabla$)?
I think that this does not hold when the section cannot be extended. Usually, when given a connection, we can compute the connection form by evaluating the expression $\nabla_X(\tilde{e}_i)$ since most cases I have seen, $e_i$ can be extended globally for the given frame so this question never occured to me. But considering my question, does one have to be careful with a choosing a frame in which we wish to find a connection over?
In full rigour, if $e_j$ is only defined on an open subset $U\subset M$, you cannot consider $\nabla_Xe_j$: the domain of $\nabla$ is $\Gamma(TM)\times \Gamma(TM)$. As you noted, $e_j$ might not be extendable outside of $U$.
Recall that affine connections are purely local, in the sense that if $X, Y$ and $Z$ are vector fields, if $p\in M$ is a point, and if $Y = Z$ in a neighbourhood of $p$, then $\nabla_XY(p) = \nabla_XZ(p)$. That in mind, consider the following.
Fix $V$ a precompact open neighbourhood of $p$ in $U$, and let $\varphi$ be a bump function that has compact support in $V$, with $\varphi=1$ around $p$. Then $\varphi e_j$ is now a global vector field on $M$, and $\nabla_X(\varphi e_j)(p)$ does not depend on $\varphi$. It is equal to $\nabla_XY(p)$ for any $Y$ that is equal to $e_j$ in a small neighbourhood of $p$.
This way, you are able to assign a unique value $\nabla_Xe_j(p)$ for any $p\in U$, even though the vector field $e_j$ isn't extendible to $M$. The corresponding function $p\mapsto \nabla_Xe_j (p)$ is a vector field on $U$, and we can consider its coefficients in the frame $\{e_1,\ldots,e_n\}$. This way, we have defined a unique connection form $\omega$ for the framed open subset $U$, whether or not the elements of the frame can be extended to $M$.