If you want to add an observed categorical moderator, you can use the "group" argument to run a multiple-group SEM (see examples on the
lavaan web site). Essentially, you allow moderation by allowing a regression parameter to differ between groups (Model A). You test whether the interaction is significant by constraining the regression parameter to equality across groups (Model B), then perform a chi-squared difference test of the equivalence in fit of those 2 models using the anova() function.
Terry