Evil can be atoned for to a certain extent by doing good, but the
evil cannot be "cancelled" without forgiveness. Forgiveness can only be
given by the one who was wronged, or by one who "absorbs" the wrong or
takes on the penalty in behalf of the shamed one.
Boromir is the honorable representative of his people. He succumbs to unworthy behavior (the attempt to take the Ring) and allows evil to take control. He is dishonored and disgraced because he is exposed as one who has "defiled" himself, and has brought dishonor to his people, and to his friend, Frodo. He is cut off from those with whom he previously had fellowship, and he is cut off from his people because of his dishonorable act. He is totally ashamed.
How can he atone for this? Up to a point, he can do something honorable to offset the evil he has done; giving his life to save the kinsmen of the one he dishonored does much to atone. But it is not enough to cancel the guilt, he still needs to be forgiven by Frodo, or by one who can act on Frodo's behalf.
Aragorn is the one who can grant this forgiveness. He is the true king, and as king, he can take on the responsibility and the perogative to forgive on Frodo's behalf. But he also has the authority to grant forgiveness in the sense that he "absorbed" the evil and the dishonor done to Frodo by Boromir, by himself successfully resisting the temptation to take the Ring for himself and use it to get what he wants most: his throne and all that comes with it. He also bears the fullness of Boromir's shame by remaining silent about his confession, and he does not tell the others about Boromir's dishonor (even in the film, Gimli and Legolas do not arrive in time to hear the exchange between the two as Boromir speaks of his dishonor as he dies), thus reducing Boromir's dishonor in the eyes of others, even as he forgives him.
Frodo has been bearing the responsibility of the safety of the Fellowship by keeping the Ring hidden, thus protecting the others from its temptation. Because Aragorn has refused the Ring's call, Frodo recognizes that he is worthy of complete trust. When he leaves to go to Mordor alone, Frodo places the responsibility of caring for the others into Aragorn's hands. In a way, Frodo has passed on his dishonor at the hands of Boromir to Aragorn.
Thus, through Aragorn, Boromir can experience forgiveness as if Frodo himself had given it, because Aragorn has now taken on this authority. By his selfless act of atonement in fighting to save Merry and Pippin, with Aragorn's pronouncement of forgiveness, Boromir's shame is now removed and his honor is maintained. How satisfying it would have been for Boromir, if he could have heard Frodo himself speak the words of forgiveness! Nevertheless, he, too, recognizes Aragorn's authority to grant forgiveness, and is content. He is able to die in peace, with a smile on his lips.