It's 3d6 with floors based on race/class
According to the Baldur's Gate fandom wikia and my own recollection playing BG1 and BG2, the stat generation is implemented as a simple 3d6 roll plus racial modifiers for each attribute, which is the default "Method I" approach used in 2e AD&D - but with the notable exception that, since the BG character generation system has you choose race and class before ability scores are generated, the values generated are floored by the minimum attribute required by the character's race and/or class.
For instance, a Paladin must have a Charisma of 17, so if the rolled Charisma score is less than 17 it is automatically raised to 17. Similarly, Elves have a minimum dexterity of 7, so if the rolled Dexterity is worse than 7, the score is just set to 7 instead. This fandom wikia page includes a table of all the minimum/maximum ability score limits for the various races and classes. These class requirements and racial minimums are taken straight from the 2e PHB, but in normal 2e character generation they apply after ability scores are generated, limiting which race and class you can choose.
These adjustments have the effect of skewing the generated results somewhat better than you would expect from rolling 3d6 down the line, to greater or lesser extent depending on exactly which combination of race and class(es) were chosen. The least advantaged combinations are human fighters, clerics, mages or thieves, since humans rock a default minimum 3 in each stat and those classes each require only one stat at 9 or better.
The mechanic allowing you to then reassign "points" in different statistics on one-to-one basis cannot be found in the 2e PHB, which provides several different alternative methods for generating ability scores besides standard 3d6 in order, but all of them involve allocating a given roll (or even individually rolled dice!) to a specific score. However, the Player's Option - Skills & Powers book does include some more ability score generation methods, a couple of which require the player to simply assign points to ability scores one-for-one - though none of them involve rolling the scores in the "normal" way and then adjusting. Skills & Powers predates Baldur's Gate by about 3 years, so these methods were available and might well have been referred to by the developers.