Her guilt comes because she knows something and does not tell others. Her uncle is suspected, and she could turn him in and protect other women. She does not do this. Uncle Charlie's guilt is transferred to his niece because she is the only one who knows about it, and this creates a dilemma for her in her family and her community. Her true guilt is entirely in not telling anyone about what she has learned of her Uncle Charlie. Her guilt is one of omission rather than commission, but it nearly leads to her death.
The fact that the names are the same is a Hitchcock device that links two characters and that allows for the audience to see easily that guilt is being transferred from one namesake to the other. Hitchcock uses other devices at different times--in The Wrong Man it is a physical similarity that is at fault, while in Vertigo it is a complex plot and the mental structure of both the hero and the two women he thinks are different people. In North by Northwest the transference is completely accidental when Thornhill calls for a bellboy. In Strangers on a Train the transference is based more on a real sense of guilt because the tennis pro does want his wife removed, though he would never kill her. More often than not, the transference is of the accidental variety, a way Hitchcock has of showing the way sin can appear at any time and the real sin of complacency that is possible in life.
The transference in Shadow of a Doubt is neither actual nor ac