I didn't think I'd get so meditative over this, but it depends on what you mean by, "sin follows for generations to come".
Sin is the transgression of the law.
1 John 3:4 (NIV)
4 Everyone who sins breaks the law; in fact, sin is lawlessness.
Though God won't hold us guilty for the specific sin committed by our ancestors (in other words, won't hold us accountable for their specific act of breaking his law), we do suffer the consequences of their choices to some extent. Prime example: Adam and Eve. When they sinned, they got kicked out of the Garden, and couldn't walk with God face-to-face anymore. We, their descendants, live in a world full of death and disease, also not walking with God "face-to-face". Adam's descendants are born sinful, with defects, who need to be conformed back to the image of God because we fell away from his image. So, yes, there are consequences for our descendants to deal with.
And there are curses: the ground was cursed.
Genesis 3:17 (NIV)
17 To Adam he said, “Because you listened to your wife and ate fruit from the tree about which I commanded you, ‘You must not eat from it,’
“Cursed is the ground because of you;
through painful toil you will eat food from it
all the days of your life.
From what I gather, the ground didn't stop being cursed once Adam died. It is still cursed because man still has to toil the ground for food. And not just we, but the creation itself, groans under decay.
Romans 8:20-23 (NIV)
20 For the creation was subjected to frustration, not by its own choice, but by the will of the one who subjected it, in hope 21 that[a] the creation itself will be liberated from its bondage to decay and brought into the freedom and glory of the children of God.
22 We know that the whole creation has been groaning as in the pains of childbirth right up to the present time. 23 Not only so, but we ourselves, who have the firstfruits of the Spirit, groan inwardly as we wait eagerly for our adoption to sonship, the redemption of our bodies.
Footnotes:
a. Romans 8:21 Or subjected it in hope. 21 For
We also inherited a sinful nature from Adam, which Jesus came to free us from.
Colossians 3:5-10 (NIV)
5 Put to death, therefore, whatever belongs to your earthly nature: sexual immorality, impurity, lust, evil desires and greed, which is idolatry. 6 Because of these, the wrath of God is coming.[a] 7 You used to walk in these ways, in the life you once lived. 8 But now you must also rid yourselves of all such things as these: anger, rage, malice, slander, and filthy language from your lips. 9 Do not lie to each other,since you have taken off your old self with its practices 10 and have put on the new self, which is being renewed in knowledge in the image of its Creator.
Footnotes:
a. Colossians 3:6 Some early manuscripts coming on those who are disobedient
Romans 8:29 (NIV)
29 For those God foreknew he also predestined to be conformed to the image of his Son, that he might be the firstborn among many brothers and sisters.
Romans 6:6 (NIV)
6 For we know that our old self was crucified with him so that the body ruled by sin might be done away with,[a] that we should no longer be slaves to sin—
Footnotes:
a. Romans 6:6 Or be rendered powerless
1 Corinthians 15:21-22 (NIV)
21 For since death came through a man, the resurrection of the dead comes also through a man. 22 For as in Adam all die, so in Christ all will be made alive.
To give an example of suffering the consequences of our ancestors' choices on a much smaller scale: say our parents commit sexual immorality, they just so happened to get an STD, we inherit the STD, we suffer; we're not guilty of their specific act of sexual immorality, but we feel the effects of their sin, the consequences.
When we break God's laws, there are repercussions, seeing as the laws themselves serve to protect our own good (and even the land's own good):
Deuteronomy 10:12-13 (NIV)
12 And now, Israel, what does the Lord your God ask of you but to fear the Lord your God, to walk in obedience to him, to love him, to serve the Lord your God with all your heart and with all your soul,13 and to observe the Lord’s commands and decrees that I am giving you today for your own good?
Leviticus 25:4 (NIV)
4 But in the seventh year the land is to have a year of sabbath rest, a sabbath to the Lord. Do not sow your fields or prune your vineyards.
All that said, if what you're referring to is something like, "breaking the spirit of rejection" over yourself because someone, somewhere in your family tree, was rejected once? Then my answer is, "that is over-mystifying; it's way simpler than that": our words and behavior affect people's emotions and minds. Ancestors don't live in a vaccuum, but in a community of other people (and obviously, within a family unit, unless they start birthing babies in artifical wombs). How they treat each other can rub off. Attitudes rub off. Personalities can rub off. Falling into sin (transgression of the law, 1 John 3:4)—whether it's idolatry, hatred, drunkenness—can become a cycle that is hard to break without divine intervention, without God changing how we speak to each other and treat each other. His wisdom / word have to get to us somehow. Until then, how we interact becomes "family tradition" (whether idolatry or hateful behavior, even if we don't recognize it as hateful towards ourselves and family [and God], but as "affection" towards ourselves and family [and God]).
So, if someone mistreated your ancestor, and that ancestor stayed bitter and weighed down instead of handing the problem off to God, then as a result, it will affect how they treat their family: attitudes are contagious; thus, passing foward a "spirit" of rejection, negativity, bitter behavior and abusive speech to those in their household. People may mistake that for a curse, when it's just an attitude and behaviorial problem that gets passed down through socialization (and not everyone chooses to act like their parents/family, like Scarlet was suggesting; thus, if you don't fall into their sinful behavior you won't be punished by God for it). But it's not the norm to deviate from your family's ways. Bad company corrupts good morals, especially if the person is not walking with God in that family. They can more easily fall into the same sinful behavior/sentiments they're surrounded by.
Because of our earthly nature that we inherited from Adam, recognizing the sin in our lives becomes difficult the longer we stray. We do not think (nor desire) to break that cycle of sin, but have an inclination to keep being abusive, hateful, and selfish. It actually gets to the point where we derive pleasure from inflicting hurt on others and upon ourselves. Other times, as is still the case for some in my family, they feel pleasure in playing the victim, so they invite abusive language on purpose, or manipulate people to press their buttons, so they can get an opportunity to play victim, and force sympathy on themselves from whomever's watching or is present—or they simply enjoy inflicting hurt and emotional abuse on others, getting a rise out of others. Our sense of love and our notion of a "good time" becomes sick and twisted. It's not something we save ourselves from.
Mankind seeks emotional abuse on purpose too, even via the entertainment we watch: as an unsaved, carnal person, we want to watch people hate, belittle, betray, and ridicule each other. We like manipulating our own emotions and the emotions of others to receive, or give, some emotional high (despite the person having to put themselves or others through emotional and physical torment to experience it, write it, film it) and we watch and applaud others for being puffed up with pride in oneself (worldly confidence). Everything about our society at this point conditions us to abuse ourselves and others, misuse creation, in body, in mind. All the more reason why it looks like "the family's been cursed". But it has nothing to do with the blood. Just who you associate with, who you exchange ideas with. Is it with God and godly people? or carnal people influenced by evil spirits instead of the Holy Spirit? He offers us a way out through various points in our lives, at least I can recognize several that I rejected.
No different than what happened to Sodom: each generation becomes more normalized to this hateful, mistreatment of God's creation. Hate, misuse, and pain replaces what God defines as love. Not just misuse of the body for unlawful sex / unlawful ways to satisfy lust, but hatred towards God and man, and selfishness in every area of life.
Ezekiel 16:49-50 (NIV)
49 “‘Now this was the sin of your sister Sodom: She and her daughters were arrogant, overfed and unconcerned; they did not help the poor and needy. 50 They were haughty and did detestable things before me. Therefore I did away with them as you have seen.
To summarize a bit: sinful behavior can be contagious, especially with the inclination we have since birth that naturally gravitates towards sin, transgressing God. Violating God's instructions (sinning) does have negative consequences (he gave those instructions for our own good; if we seek to break them, then by definition we seek to harm ourselves and others. That harm can have lasting effects, and can affect more than our immediate generation—which is why some sins are dealt with severely). Being in relationship with God is the only way to break that cycle of sin that has become the norm in one's family. But even if we repent and get forgiven of it, we're still living on a cursed earth. God doesn't hold us accountable for someone else's sins (the only exception being if a sinless someone volunteers, i.e. God/Jesus, our sinless, unblemished scapegoat; otherwise, everyone suffers the punishment of their own sin). He's not going to send a demon on a believer just because someone on their family tree was a demon-worshipper.
On that note: we can be subject to demonic activity when we're not under his protection anymore (for having deviated from his commands and grieved His Holy Spirit) like King Saul, i.e. 1 Samuel 16:14, and like the Israelites wandering in the wilderness.
1 Samuel 15:24-26 (NIV)
24 Then Saul said to Samuel, “I have sinned. I violated the Lord’s command and your instructions. I was afraid of the men and so I gave in to them. 25 Now I beg you, forgive my sin and come back with me, so that I may worship the Lord.”
26 But Samuel said to him, “I will not go back with you. You have rejected the word of the Lord, and the Lord has rejected you as king over Israel!”
1 Samuel 16:14 (NIV)
14 Now the Spirit of the Lord had departed from Saul, and an evil[a] spirit from the Lord tormented him.
Footnotes:
a. 1 Samuel 16:14 Or and a harmful; similarly in verses 15, 16 and 23
Isaiah 63:10 (NIV)
10 Yet they rebelled
and grieved his Holy Spirit.
So he turned and became their enemy
and he himself fought against them.
He might send the devil to afflict, refine, and tempt us (our choice if we bite into temptation or not, i.e. Luke 22:31; James 1:13-15).
Luke 22:31 (NIV)
31 “Simon, Simon, Satan has asked to sift all of you as wheat.
James 1:13-15 (NIV)
13 When tempted, no one should say, “God is tempting me.” For God cannot be tempted by evil, nor does he tempt anyone; 14 but each person is tempted when they are dragged away by their own evil desire and enticed. 15 Then, after desire has conceived, it gives birth to sin; and sin, when it is full-grown, gives birth to death.
Adam and Eve didn't pass. They were enticed away by their own desires instead of standing firm on God's instructions. Job passed the trial, didn't resort to violating God's commands to get out of his suffering, nor ascribed evil to God because of his suffering. But what all these examples have in common: it's not because of bloodline. It's the testing of the individual. And everyone is getting tested. Related or not (edit: technically, we're all related though...).
To answer your question in a nutshell (lol): bloodline has little to do with it; your relationship with God (lack of, broken, or solid and reconciled relationship with God) and the company you keep, determines what ends up affecting you and your household— whether you live in a cursed world (with a family tree full of sinful ancestors), or you lived in perfect conditions with absolutely no ancestors to speak of. There can still be attacks from the devil.
edited because I forgot to add Isaiah 63:10 lol