On the regularity and Koszulness of modules over local rings