The Formal charge is not an actual charge of any atom, it is the hypothetical charge if all the bonds were 100% covalent.
Oxidation state is the hypothetical charge on an atom if all the bonds are 100% ionic. There are no 100% ionic bonds.
Formal charge (FC) calculation ....
FC = VE - NBE - ½BE [ VE=valence electrons, NBE=non-bonding electrons, BE=bonding electrons ]
Oxygen has six valence electrons. Oxygen can have a formal charge of +1 with two lone pairs and one bond, but that doesn't give oxygen an octet of electrons.
FC = 6 - 4 - 1 = +1
A second possibility is one lone pair and three bonds which will give oxygen a +1 formal charge. (As in H3O^+)
Nitrogen has five valence electrons. Nitrogen can have a formal charge of +1 with one lone pair and two bonds. Nitrogen won't have an octet, either.
FC = 5 - 2 - 2 = +1
Another possibility is no lone pairs and four bonds.
FC = 5 - 0 - 4 = +1