Let $X$ be the set of all well-orderings of the set of natural numbers, and let $O$ be the set of countable ordinals, i.e. the set of ordinals that are order types of the well-orderings in $X$. Then my question is, is it possible to use transfinite recursion to define a function $f:O\rightarrow X$ where for each ordinal $\alpha\in O$, $f(\alpha)$ is a well-ordering of the set of natural numbers with order type $\alpha$?
The base case is easy enough; we can let $f(\omega)$ be the standard order on $\mathbb{N}$. And the successor case is easy; if we know what $f(\alpha)$ is, then to define $f(\alpha+1)$ we can apply (an analogue of) $f(\alpha)$ to $\mathbb{N}-0$ and then append 0 to the end of it.
But how do we do the limit case, i.e. if $\lambda$ is a limit ordinal in $O$ and we know the values of $f(\alpha)$ for all $\alpha<\lambda$, how can we define $f(\lambda)$?
Yes, but not really.
For a limit ordinal $\alpha$, you can choose a cofinal increasing sequence $\alpha_n$ going to $\alpha$ with $\alpha_0=0$, then partition $\Bbb N$ into infinitely many infinite sets, $A_n$, then order $A_n$ with the well-ordering given by $f(\alpha_{n+1}\setminus\alpha_n)$ (composing it with the natural enumeration that is), and thus create a well-order of type $\alpha$. Of course, if $\alpha_{n+1}\setminus\alpha_n$ is a finite ordinal, require that $A_n$ is of the right size instead of infinite.
But to do so for all the countable ordinals, you need to choose for all limit ordinals these cofinal sequences. Of course, this is doable with the axiom of choice. But if you're appealing to the axiom of choice, it's easier to just consider the function $\operatorname{otp}\colon X\to O$, mapping each well-order to its order type, noting it is surjective, and just choosing an inverse map.
Without the axiom of choice, which is perhaps what you'd like to do, and have this done more... constructively, it is consistent that no such injection exists. Or that there are no injections at all from the set of countable ordinals into the set of well-orderings of $\Bbb N$.
To sum up, you can do this, but not constructively. And since you're already applying the axiom of choice, might as well leave the recursive construction behind and just use choice directly.