Let us see that the minimum number of operations that Ana has to make is 2.
In the first operation, Ana balances five weights in one side with two in the other. The weight of five weights is at least 1+2+3+4+5=15, and the weight of two weights is at most 7+8=15. Then, the only possibility to achieve balance is that the weights in one pan are 1, 2, 3, 4, 5 and the weights in the other pan are 7 and 8.
In the second operation, Ana balances the weight of 8 grams in one side, with the weight of 7 grams together with the weight of 1 gram in the other side.
Since Beto had identified the weights of 7 and 8 grams after the first operation (even if he does not know the weight of each of them), he deduces that the third weight considered by Ana in the second operation is that of 1 gram.
Finally, let us show that Beto cannot identify the weight of 1 gram in only one operation. When Ana makes an operation, there are three groups of weights: those in the left side of the balance, those in the right side, and those that remain outside. To determine which is the weight of 1 gram, it should be the only weight in one of these groups. It cannot be the only weight outside the balance, since the weight of the remaining ones is 2+3+4+5+6+7+8=35, which is odd, so there is no way to achieve balance with them. It is not possible either to achieve balance by leaving the weight of 1 gram alone in one side. The proof is complete.