By sin, I assume that you mean transgression of the law?
That is part of what sin is, yes; but sin is much more than that. You seem to see sin only as imputed sin. Like already established here, sin started with Adam and Eve long before any formally established "law" disobeying God's instructions and commands, specifically, not to eat the fruit of the tree of the knowledge of good and evil. Just as with Adam and Eve, violation of any imperative command given in God's Breathed Inerrant Word OT or NT is sin.
Types of sin: 1) inherited, 2) imputed, 3) personal. Please refer to this link for a further explanation:
What is the definition of sin? | GotQuestions.org
ADDITIONALLY from another source: (below are all excerpts from a link given below, I advise one go there for a much better presentation. One will find additional types of sin described in this article.)
"The definitions of sin in the Bible are not simply arbitrary dos and don’ts. Instead, they show us the way God lives. They show the spiritual principles by which He lives, the same standard of conduct He expects His human creations to live by."
"We have seen
one standard God has set for mankind: He expects obedience to His laws. God’s law defines acceptable behavior and actions, and, when we break the standard of God’s law, we step across the bounds He has set. But has God set other boundaries for us, other ways in which He defines sin? What about actions and behavior that aren’t covered by specific laws?
In 1 John 5:17 we find a much broader definition of sin: “All unrighteousness is sin . . .”
Other Bible versions help us more fully understand the meaning: “Every wrong action is sin” (Twentieth Century New Testament). “Every act of wrong-doing is sin” (Phillips Modern English). “Any kind of wrongdoing is sin” (Weymouth New Testament in Modern Speech). “All iniquity is sin” (Moffatt Translation).
The
basic thrust of this scripture is that, if any action or behavior is wrong, it is sin."
"These meanings go beyond just physical deeds and actions and cross over into attitudes and motives for our actions and what goes on in our minds. They involve what we think. We see the beginnings of a different standard, one that involves not just what we do but what we are."
"Jesus Christ showed that sin includes not only our physical actions, but also our thoughts and attitudes.
He explained this further in verses 27-28: “You have heard that it was said to those of old, ‘You shall not commit adultery.’ But I say to you that
whoever looks at a woman to lust for her has already committed adultery with her in his heart.” Christ said that this sin is not defined by just a physical act; if
we even allow such a thought in our mind we have sinned. We have mentally crossed that boundary, trampling that limit God gave us.
We should realize that sin starts in the mind."
"Humanly speaking, we don’t see anything wrong with allowing wrong thoughts into our minds. Often they are quite pleasurable and entertaining. But eventually those sinful thoughts lead us into sin. The result is the trampling of God’s law.
Jesus Christ instructs us to disrupt that process before it gets started, by not even allowing wrong thoughts into our minds."
"In Romans 14 God reveals yet other ways in which we can fail to measure up to His standards." "Paul addressed this problem in verses 19-22, telling Christians to be careful that they don’t offend those newer and weaker in the faith. Then notice what Paul said in verse 23: “But he who doubts is condemned if he eats, because he does not eat from faith; for
whatever is not from faith is sin.”"
"It is not within our natural ability to discern right and wrong (Jeremiah 10:23). We are to learn God’s ways that define right and wrong for us (Hebrews 5:14).
God wants us to live within the boundaries and standards He has set for us, to change our values, attitudes, thoughts and lives so they are in line with His standards, not our own. The process of conversion can be simply defined as replacing our standards, values and thoughts with God’s standards, values and thoughts."
"Did you realize that we could go through life without ever stealing, lying, hating or breaking a single command from God, all the while perfectly controlling our thoughts, and yet still sin every day of our lives? We could avoid all those things, but we could still be sinning according to this last definition of sin. Most of us probably don’t realize we are involved in this last kind of sin and probably don’t even realize that it is a sin.
We have seen that we can sin by the things we do.
But we can also sin by the things that we don’t do.
James 4:17 tells us, “Therefore, to him who knows to do good and does not do it, to him it is sin.” Perhaps you have heard of sins of commission, sinning by the actions we take: stealing, lying, committing adultery and so on. But this verse tells us that some transgressions involve sins of omission, sinning by things we omit doing."
A more comprehensive and cohesive presentation of the above quotes since the emboldened word
"Additionally" is much better presented here by
Scott Ashley:
How Does the Bible Define Sin?