Modeling the role of epigenetic inheritance in adaptation and phenotypic heritability