We have no idea how that information is transmitted from generation to generation but we have enough animal behavior research to know that many animals instinctually identify visual cues like predators pretty much from the moment they are born. We also have decent evidence that the inheritance may not be entirely genetic in origin, because nearly identical populations in different locales may have wildly different behaviors (like the animals in the Galapagos islands, who aren’t afraid of humans because they’ve had no predators).
The three main candidates for how this information is transmitted are: genetics, epigenetics, and embryonic development. The latter two fields are still in their infancy but that leaves more room for just so stories.
Always beware of anyone using evolutionary biology to make an argument about the development of species.