Christians are to do as Jesus did. The implication in the larger context is that those who claim to be Christian must live morally, as He did. We are to follow His example and to have the same ethic as He did - especially as it echoes what He says in John 8:28-29, which strongly implies that His behavior was drawn directly from God the Father.
The emphasis in I John 2:6 is on the way that one lives. To some, Christianity is little more than an intellectual exercise. Some of these people may study frequently and spend long hours doing it. Somehow, though, it never translates into the practical aspects of living; it is purely intellectual. They do a lot of research, but their lives never really change.
There are others whose relationship with God is largely based on feelings. Because feelings are transient - they come and they go, they change - these people's lives are constantly up and down and highly irregular. They blow hot and cold. John stresses that a Christian must follow the same pattern of life as Jesus lived, and He did not fly from pillar to post based on His emotions!
There is another aspect of this, too: Jesus was baptized, but He never sinned. He said to John the Baptist that the reason that He did it is to fulfill all righteousness, that is, to fulfill all right doing. We are baptized because we have sinned and because God commands it of us. He wants us to make a public statement of our commitment and the giving of our life, the sacrifice of it, to be raised in the likeness of Christ's resurrection.
Christ did not fit any of those parameters. The fact that He did it makes a point: He was baptized to do what was going to be required of us, those who would follow Him. Therefore, He did it as an example. He never offered an animal sacrifice. Why? It would not be required of us. Even so, it would have not have been technically wrong for Him to do so, even as Paul went through one of the Old Covenant rituals in the book of Acts.
Jesus Christ kept the Sabbath and the holy days, and those whom He personally trained also did. That is a powerful lesson. We cannot go wrong following His example, regardless of whether a specific law is stated.