The question perfectly illustrates the difference between the modern individualistic culture and the ancient collective culture.
In ancient times, if the leader(s) decided to do something then the whole nation/community had done it. We see this many times and is why Israel was referred to as such - called by the progenitor of the nation. Edom, Moab, Ammon, all are called by the founder.leader of the nation.
here is another example - Gen 32:3 - "Edom" is referred to as the "brother of Jacob" when talking about two huge nations; both individuals, Edom (= Esau) and Jacob we long dead.
Thus, in Acts 2:23, when Peter refers to "you" he is blurring (consistent with ancient idiom) he is obviously discussing the Jewish leadership at the time of the crucifixion in which the whole nation had some shared guilt.
However, we also see the beginning of a transition to individual responsibility in that Peter offers individual freedom from that guilt by the grace of forgiveness in Acts 2:38 -
Peter replied, “Repent and be baptized, every one of you, in the name
of Jesus Christ for the forgiveness of your sins, and you will receive
the gift of the Holy Spirit.