IMPRINTING
Children know their mothers well within the first 30 seconds of being born. Just to be held would be enough. With the force involved she'd sense that sadness in Padme. Plus, when babies are in their mothers they get a good sense of who their mother is. They grow attached before birth. Maybe when they were born Anakin was held by someone else and then Leia was in her mother's arms when she died. MAYBE. Doubt it though. Unless they do something like that then it remains a plothole.