encoding 4:2:2 in 10-bit with libx264
x264 supports both 8-bit and 10-bit outputs, and you don't have to do anything special.

ffmpeg

If using ffmpeg you can see what pixel formats and bit depths are supported by libx264:

$ ffmpeg -h encoder=libx264
  [...]
  Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21 yuv420p10le yuv422p10le yuv444p10le nv20le


10-bit pixel formats are: yuv420p10le, yuv422p10le, yuv444p10le.

x264

You can also check x264 for supported bit depths:

$ x264 --help
  [...]
  Output bit depth: 8/10


Previously you had to compile x264 with --bit-depth=10, and then link your ffmpeg to either an 8-bit or 10-bit libx264, but that is now unnecessary. See Unify 8-bit and 10-bit CLI and libraries for more info.