Biosynthesis of pipecolic acid and 4-hydroxypipecolic acid